Clean Code

We have added some development tools for you to contribute to the library with clean code:

Using PHP mess detector

PHP mess detector takes a given PHP source code base and look for several potential problems within that source. The following is a sample usage with all options available:

./vendor/bin/phpmd ./src text codesize,unusedcode,naming,design,controversial,cleancode

For further information, please visit PHP mess detector documentation

Using PHP code sniffer

Global settings file: phpcs.xml.dist (added into Git)
Local settings file (you can add it locally): phpcs.xml (ignored by Git)

For further information, please visit squizlabs/PHP_CodeSniffer

Using PHP code fixer

Global settings file: .php_cs.dist (added into Git)
Local settings file (you can add it locally): .php_cs (ignored by Git)

For further information, please visit FriendsOfPHP/PHP-CS-Fixer

Running Tests

We are using Codeception for testing the module. To run tests do the following:

We still need to add unit tests to the module. Feel free to add your tests to it as long as it makes use of Codeception.

© 2amigos 2013-2017