- Coding standard for the project is PSR-12
- Any contribution must provide tests for additional introduced conditions
- Any un-confirmed issue needs a failing test case before being accepted
- Pull requests must be sent from a new hotfix/feature branch, not from
main
.
To install the project and run the tests, you need to clone it first:
git clone git@github.com:CHStudio/Raven.git
You will then need to run install local dependencies using composer.
composer update
If you don't have composer installed locally, you can install it using the official procedure
You can also install it inside the project using Phive. The dependency list with version constraint is available: .phive/phars.xml.
We created a Dockerfile which define a valid
image to work on Raven. Some convenience scripts are present in the bin
folder
which are shortcuts to inner container binaries: php
, phive
. All the
following commands must be executed from the host, not inside the container.
bin/php # will run the php version from the container
bin/phive # will run the phive version from the container
A common getting started scenario will be:
# Install external binaries in the tools folder.
bin/phive update
# Install library dependencies.
bin/php tools/composer update
# Run development tools
bin/php vendor/bin/phpunit
bin/php vendor/bin/phpstan
bin/php vendor/bin/php-cs-fixer
If you want to allow your system to detect and use those binaries automatically,
you need to update your PATH
environment variable:
export PATH="./bin:$PATH"
# Then you can run directly the scripts which will use the current PHP version
# based on your new PATH.
vendor/bin/phpunit
vendor/bin/phpstan
vendor/bin/php-cs-fixer
tools/composer
PHPUnit is our unit testing framework of choice. The version to be used is the one installed as a dev- dependency via composer:
vendor/bin/phpunit
Please ensure all new features or conditions are covered by unit tests.
This library use PHP-CS-Fixer to validate and ensure PSR-12 compliance. The version to be used is the one installed as a dev- dependency via composer:
vendor/bin/php-cs-fixer fix
This library uses PHPStan to perform static analysis over the code. The version to be used is the one installed as a dev- dependency via composer:
vendor/bin/phpstan