The project follows the Open Knowledge International coding standards.
All PHP Code MUST conform to PHP-FIG accepted PSRs.
Flow Framework has a nice guide regarding coding standards:
With Docker:
- Clone the repo
- Install the Composer dependencies
$ docker-compose run --rm tblschema composer install
- Run the tests
$ ./docker-run-tests.sh
Without Docker:
- Clone the repo
- Install the Composer dependencies
$ composer install
- Run the tests
$ composer test
Phpunit is used for unit tests, you can find the tests under tests directory
Running Phpunit directly: vendor/bin/phpunit --bootstrap tests/autoload.php tests/
when running composer test
phpunit generates coverage report in coverage-clover.xml - this is then sent to Coveralls via a Github Action.
Scrutinizer-ci integrates with GitHub and runs on commits.
It does static code analysis and ensure confirmation to the coding stnadards.
At the moment, the integration with frictionlessdata repo is not working, you can setup a Scrutinizer-ci account for your fork and run against that.
php-cs-fixer can be used to check and fix code style.
You need to manually install it, then you can run the following :
- With Docker:
# Check styles $ ./docker-style-check.sh # Automatically fix styles $ ./docker-style-fix.sh
- Without Docker:
# Check styles $ composer style-check # Automaticall fix styles $ composer style-fix
- Packagist is automatically updated by the Packagist GitHub service
- all releases from GitHub appear as releases on Packagist automatically
The json schema for table schema might be modified from time to time, to update it run composer update-schema
Then, you should review the changes, and possibly write / update unit tests to match the new schema.