Essential Composer Packages

Every PHP developer worth their salt uses Composer to manage their dependencies. That’s because Composer is a crucial component of modern PHP development. It’s by far the best way to manage 3rd party code. The number of composer packages available on Packagist is staggering – as is the number of downloads for some projects. It’s easy to get overwhelmed. So I did what any lazy developer would do – I asked a question on Twitter

The Question

What are your favorite individual (non-framework) Composer packages? Which ones do you feel are required by other developers? #PHP

source tweet

I phrased the question this way, because I figured that frameworks like Symfony and Laravel would dominate everyone’s responses. Discovering which individual packages was more interesting to me. Ya know, it’s funny. I assumed that everyone would have the same 4-5 packages, but boy was I wrong! Here’s the list I expected:

  • monolog/monolog
  • phpunit/phpunit
  • ramsey/uuid
  • squizlabs/php_codesniffer
  • vlucas/phpdotenv

The Results for Composer Packages

The results I actually received were far more interesting and varied. On a couple of responses, only 1 or 2 packages were mentioned. Other people were more liberal in the packages they recommended. The Monolog project is the only one I guessed right. It worth keeping in mind that the 15-20 people that responded to my tweet, are only a small subset of the PHP community. While not a statistically viable sample, you get a sense of the vast array of PHP projects. Can you say “long tail“? The number before the package name is the number of responses that mentioned it. The number of “votes” if you will.

  • 5 monolog/monolog
  • 3 league/flysystem
  • 3 league/fractal
  • 3 php-di/php-di
  • 3 phpstan/phpstan
  • 3 roave/security-advisories
  • 3 symfony/console
  • 2 doctrine/dbal
  • 2 infection/infection
  • 2 league/tactician
  • 2 nesbot/carbon
  • 2 nikic/fastroute
  • 2 phpunit/phpunit
  • 2 squizlabs/php_codesniffer
  • 2 twig/twig
  • 2 vlucas/phpdotenv
  • 2 zendframework/zend-diactoros
  • 1 aura/di
  • 1 bitexpert/disco
  • 1 bunny/bunny
  • 1 friendsofphp/php-cs-fixer
  • 1 fzaninotto/faker
  • 1 genkgo/mail
  • 1 hirak/prestissimo
  • 1 jms/serializer
  • 1 league/container
  • 1 league/event
  • 1 league/route
  • 1 lodash-php/lodash-php
  • 1 nikic/php-parser
  • 1 phpdocumentor/phpdocumentor
  • 1 phpmd/phpmd
  • 1 phpspec/phpspec
  • 1 psr/container
  • 1 psr/log
  • 1 ramsey/uuid
  • 1 rdlowrey/auryn
  • 1 symfony/thanks
  • 1 vlucas/frisby
  • 1 vlucas/valitron
  • 1 zend/service-manager
  • 1 zendframework/zend-servicemanager

The Humbug project gets an honorable mention. However, since it’s a deprecated project, it’s recommended that you use Infection instead, if you’re interested in mutation testing.

Wrap Up

If you’re not familiar with what some of these projects are, that’s ok. Looking through these project is a great way to learn about them. That’s what I’ll be doing! Who knows? One of these projects may be just the thing you need for your next project.

Sorry, but comments are closed. I hope you enjoyed the article