PHPWord is built by the crowd and for the crowd. Every contribution is welcome; either by reporting a bug or suggesting improvements, or in a more active form like requesting a pull.
We want to create a high quality document writer and reader library that people can use with more confidence and fewer bugs. We want to collaborate happily, code joyfully, and live merrily. Thus, below are some guidelines that we expect to be followed by each contributor:
composer fix
to automatically fix your code to match these recommendations.composer test
. Documentation for writing tests with PHPUnit is available on Read the Docs.cd ~/Projects/PHPWord/
)composer install
to install the dependenciesYou're ready to start working on PHPWord! Tests belong in the /tests/PhpWord/
directory, the source code is in /src/PhpWord/
, and any documentation should go in /docs/
. Familiarize yourself with the codebase and try your hand at fixing one of our outstanding issues. Before you get started, check the existing pull requests to make sure no one else is already working on it.
Once you have an issue you want to start working on, you'll need to write tests for it, and then you can start implementing the changes necessary to pass the new tests. To run the tests, you can run one of the following commands in your terminal:
composer test-no-coverage
to run all of the testscomposer test
to run all of the tests and generate test coverage reportsWhen you're ready to submit your new (and fully tested) feature, ensure composer check
passes and submit a pull request to PHPWord.
That's it. Thank you for your interest in PHPWord, and welcome!
May the Force be with you.