Contributing to sebastian/code-unit
May 21, 2025 ยท View on GitHub
Welcome!
We look forward to your contributions! Here are some examples how you can contribute:
We have a Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Any contributions you make will be under the BSD-3-Clause License
When you submit code changes, your submissions are understood to be under the same BSD-3-Clause License that covers the project. By contributing to this project, you agree that your contributions will be licensed under its BSD-3-Clause License.
Do Not Violate Copyright
Only submit a pull request with your own original code. Do NOT submit a pull request containing code which you have largely copied from another project, unless you wrote the respective code yourself.
Open Source does not mean that copyright does not apply. Copyright infringements will not be tolerated and can lead to you being banned from this project and repository.
Do Not Submit AI-Generated Pull Requests
The same goes for (largely) AI-generated pull requests. These are not welcome as they will be based on copyrighted code from others without accreditation and without taking the license of the original code into account, let alone getting permission for the use of the code or for re-licensing.
Aside from that, the experience is that AI-generated pull requests will be incorrect 100% of the time and cost reviewers too much time. Submitting a (largely) AI-generated pull request will lead to you being banned from this project and repository.
Write bug reports with detail, background, and sample code
This is an example of a bug report I wrote, and I think it's not too bad.
In your bug report, please provide the following:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
Please do not report a bug for a version of this library that is no longer supported. Please do not report a bug if you are using a version of PHP that is not supported by the version of this library you are using.
The library that is developed in this repository was either extracted from PHPUnit or developed specifically as a dependency for PHPUnit. Support for this library follows the support for the version of PHPUnit that uses a specific version of this library.
Please post code and output as text (using proper markup). Do not post screenshots of code or output.
Workflow for Pull Requests
- Fork the repository.
- Create your branch from
mainif you plan to implement new functionality or change existing code significantly; create your branch from the oldest branch that is affected by the bug if you plan to fix a bug. - Implement your change and add tests for it.
- Ensure the test suite passes.
- Ensure the code complies with our coding guidelines (see below).
- Send that pull request!
Please make sure you have set up your username and email address for use with Git. Strings such as silly nick name <root@localhost> look really stupid in the commit history of a project.
We encourage you to sign your Git commits with your GPG key.
Pull requests for bug fixes must be made for the oldest branch that is supported (see above). Pull requests for new features must be based on the main branch.
We are trying to keep backwards compatibility breaks to an absolute minimum. Please take this into account when proposing changes.
Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us if you feel that we forgot to respond.
Development
This project uses PHPUnit for testing:
./vendor/bin/phpunit
This project uses PHPStan for static analysis:
./tools/phpstan
This project uses PHP-CS-Fixer to enforce coding guidelines:
./tools/php-cs-fixer fix
The commands shown above require an autoloader script at vendor/autoload.php. This can be generated like so:
./tools/composer dump-autoload
Please understand that we will not accept a pull request when its changes violate this project's coding guidelines or break the test suite.
Low Maintenance Project
This library was developed specifically as a dependency for PHPUnit. Starting with PHPUnit 12, PHPUnit no longer depends on this library.
This library is now a low maintenance project. Bugs that have an impact on versions of PHPUnit that still receive bug fixes and still depend on this library will be fixed in this library.
Aside from the above, no further development of this library is planned.