For the Tiki code development it is very useful tool (which is also being run automatically on Gitlab CI for each push or merge request) to check if your code meets the Tiki PHP coding standards.
Installation
In your Tiki root run the following command:
$ ./temp/composer.phar install --prefer-dist --working-dir="vendor_bundled"
This will install the development packages from Composer.
Usage
For example, to check a file in lib/
:
$ php vendor_bundled/vendor/squizlabs/php_codesniffer/bin/phpcs lib/ocrlib.php
To fix a file auto-magically:
$ php vendor_bundled/vendor/squizlabs/php_codesniffer/bin/phpcbf lib/ocrlib.php
Related
Also see:
- https://github.com/squizlabs/PHP_CodeSniffer
- Example of errors reported on Gitlab CI pipeline job: https://gitlab.com/tikiwiki/tiki/-/jobs/498451366