Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 1.64 KB

CONTRIBUTING.md

File metadata and controls

68 lines (53 loc) · 1.64 KB

Contributing to Zap*

Find a bug? Help us fix it.

  1. Fork from Github.

  2. Clone your fork and load dependencies:

    $ git clone git@github.com:${YOUR_GITHUB_USERNAME}/zapcore.git
    $ cd zapcore
    $ composer -vvv install -no
  3. Make your changes. Sources are in ./src and occasionally also in ./dev directories.

    $ # do your thing, e.g.:
    $ vim src/Router.php
  4. Adjust the tests. Make sure there's no failure. Tests are in ./tests directory.

    $ # adjust tests, e.g.:
    $ vim tests/RouterTest.php
    $ # run tests
    $ phpunit || echo 'Boo!'
  5. Make sure code coverage is at 100% or close. If you have Xdebug installed, coverage report is available with:

    $ phpunit
    $ x-www-browser docs/coverage/index.html
  6. Make sure coding convention is met as much as possible. For automated check, use code sniffer and mess detector rulesets that come with this repository:

    $ export PATH=~/.composer/vendor/bin:$PATH
    $
    $ # coding convention compliance with phpcs
    $ composer global require squizlabs/php_codesniffer
    $ phpcs \
    >     --standard=./phpcs.xml \
    >     --extensions=php \
    >     --runtime-set ignore_warnings_on_exit 1 \
    >     --report-width=72 \
    >     --no-cache \
    >     src
    $
    $ # static analysis with phpmd
    $ composer global require phpmd/phpmd
    $ phpmd ./src text ./phpmd.xml
  7. Push to your fork and submit a Pull Request.