Jordi Boggiano has a new post to his site today sharing some interesting PHP package statistics he gathered as a part of the metadata in the Composer/Packagist ecosystem.
This one started in a peculiar way. Paul M. Jones announced a new version of his Producer tool, I had a look at it and saw that it recommended having a changelog called CHANGES.md by default. […] My first thought was to report an issue asking to change the default, but then I thought it’s Paul, he will not just take my word for it, he will want hard facts. So here I am two days later. I queried GitHub’s API for the file listing (only the root directory) of all PHP packages listed on packagist.org. What this let me do is look at what files are commonly present (and not), which is quite interesting to get a picture of the whole ecosystem.
He queried about 79,000 packages and found some interesting patterns in the results. These included findings like:
- 8% have a DependencyInjection/ directory, which I believe indicates Symfony bundles
- 3.6% have a examples/ and 3.5% a docs/ directory
- 49% have some file or directory indicating the presence of tests (phpunit.xml & co)
- 14% have committed their composer.lock
- 8% show a presence of some code quality/style CI (scrutinizer, codeclimate, styleci)
There’s some other interesting statistics in the post around license files, changelogs and CLI binaries too. He’s also posted the full data set for anyone interested in running some of their own statistics on the results.