achertovsky / phptools
Requires
- php: ^8.0
- achertovsky/phpdrc: ^0.3.1
- phpmd/phpmd: ^2.0
- phpstan/phpstan: ^2.0
- povils/phpmnd: ^3.5
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-12-27 18:07:25 UTC
README
Toolset which usually required to develop php and check code you write. Contains:
- phpstan
- phpmd
- phpcs
- phpcpd
- phpmnd
Usage
Dependencies
Make sure your env has app called xq
, install it via package manager
Install and first run
composer require --dev achertovsky/phptools
vendor/bin/suggest-config
vendor/bin/phptools
Notes
phpstan-related
phpstan launched with --memory_limit=-1
flag due to widely-known issues so to not it leat all memory of your machine use -m
param of docker to limit container memory
phptools
options applicable
-m
will check files that is modified/added according togit
-p test.php
will check provided file only
phpcpd
phar placed in lib code is box'ed from latest phpcpd main branch code and do not belong to lib author
Tools config
You can create your own
config file for phpcs
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file
config file for phpmd
https://phpmd.org/documentation/creating-a-ruleset.html
config file for phpstan
https://phpstan.org/config-reference#config-file
config file for phpcpd
check phpcpd.xml
file in config
directory
config file for phpmnd
check phpmnd.xml
file in config
directory
config file for phpdrc
https://github.com/achertovsky/phpdrc/blob/master/readme.md#config
Development
docker build -t phptools .
docker run --rm -it -u${UID} -v${PWD}:/var/www/html -w/var/www/html phptools composer i
cp config/* .
docker run --rm -it -u${UID} -v${PWD}:/var/www/html -w/var/www/html phptools php phptools