Add more tools to PHPQA
- PHP Magic Number Detector: PHP Magic Number Detector.
- PhpAssumptions: Tool to detect assumptions.
- PhpCodeAnalyzer: PhpCodeAnalyzer finds usage of non-built-in extensions in your php code.
$ php vendor/bin/phpqa-extensions.php --tools
List of available tools
=======================
--------------------------- -------- ----------------------------- -----------
Name CLI Composer Installed
--------------------------- -------- ----------------------------- -----------
PhpAssumptions phpa rskuipers/php-assumptions No
PhpCodeAnalyzer phpca wapmorgan/php-code-analyzer No
PHP Magic Number Detector phpmnd povils/phpmnd No
--------------------------- -------- ----------------------------- -----------
$ php vendor/bin/phpqa-extensions.php --add phpmnd
or
$ php vendor/bin/phpqa-extensions.php --add "PHP Magic Number Detector"
or
$ php vendor/bin/phpqa-extensions.php --add povils/phpmnd
Several tools can be add in one times:
$ php vendor/bin/phpqa-extensions.php --add phpmnd --add phpa
$ php vendor/bin/phpqa-extensions.php --enable phpmnd:\MacFJA\PHPQAExtensions\Tools\Analyzer\PhpMagicNumber:app/report/phpmagicnumber.xsl
The syntax of the parameter --enabled
is: $CLI_NAME$:$WRAPPER_CLASS$
or $CLI_NAME$:$WRAPPER_CLASS$:$REPORT_PATH$
.
With:
$CLI_NAME$
: The name of the CLI command$WRAPPER_CLASS$
: The class that will be used by PHPQA to call the tool$REPORT_PATH$
: The relative path of the XLST file to do the HTML transformation (optional)
Option name | Default | Tool | Description |
---|---|---|---|
phpmnd.ignore-numbers | null | PHP Magic Number Detector | List (comma separate) of number to ignore (typically 0,1,2) |
phpmnd.ignore-funcs | null | PHP Magic Number Detector | List (comma separate) of function to ignore |
phpmnd.ignore-strings | null | PHP Magic Number Detector | List (comma separate) of strings value to ignore |
phpmnd.strings | false |
PHP Magic Number Detector | Activate the strings literal analysis |
phpca.since | null | PhpCodeAnalyzer | Only include extensions not included since version |
phpca.extension | null | PhpCodeAnalyzer | Look for usage of a specific extension |
If you found a nice tool that you want to added, open a issue on GitHub.
You can also create Pull Request of a new tool.