PHP Package Checklist
There's a lot that goes into a successful PHP package beyond simply having some useful code. The following checklist will help ensure that your package is taken seriously by the rest of the PHP community.
(Click to toggle items and create a custom report)
Pick a name wisely
Ensure the name isn't already used by another project.
Maintain consistency between this name and your PHP namespace.
Avoid using last names or personal handles in your PHP namespaces.
Host source openly
GitHub is free to use for public projects. GitHub is helpful for managing issues, feature requests and pull requests.
PSR-4 compatible autoloader namespace. Place code in the
Distribute via Composer
Make your library available via
Composer, the dependency manager for PHP. List on
Packagist, the main Composer repository.
Don't limit your project to just one framework.
Offer framework specific support by supplying service providers.
DocBlock your code
DocBlock serve as inline documentation.
They can also improve code completion in IDEs, like
PhpStorm. Can be automatically converted into API documentation, see
Use semantic versioning
Semantic Versioning to manage version numbers. Follow the MAJOR.MINOR.PATCH system.
Allows devs to upgrade safely, without worrying about breaking changes.
Remember to tag releases in a timely manner!
Keep a changelog
Show notable changes that have been made between releases.
Consider following the
Keep a CHANGELOG format.
Use continuous integration
Use a service to automatically check coding standards and run tests.
Great way to run tests on multiple versions of PHP.
Can be automatically run when pull requests are submitted.
Travis-CI, Scrutinizer, Circle-CI.
Write extensive documentation
Good documentation is vital to the success of any package.
At a minimum include a detailed README in your repository.
Consider hosting documentation on
GitHub Pages. Alternatives:
Read the Docs.
Include a license
Including a license is a simple step that can help protect the work you've done.
choosealicense.com. Most PHP projects use the MIT License. At a minimum, include a LICENSE file with your library.
Also consider adding your license in the
If you want help on your project, be sure to ask for it!
Have a CONTRIBUTING file, welcoming contributions to the project.
Use this file to explain any project requirements, such as tests.