fox91 / dev-tools
fox91 Dev Tools
v0.10.0
2024-03-10 13:59 UTC
Requires
- php: ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
- fox91/coding-standard: ^0.3.1
- php-parallel-lint/php-console-highlighter: ^0.5.0 || ^1.0.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.15.1 || ^0.16.0 || ^0.17.0 || ^0.18.0
- rector/rector: ^1.0.0
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.6
- vimeo/psalm: ^4.6 || ^5.0
Suggests
- brainbits/phpstan-rules: [--dev] PHPStan extension with opinionated strict rules for better code in tests
- ergebnis/phpstan-rules: [--dev] Provides additional rules for phpstan/phpstan
- korbeil/phpstan-generic-rules: [--dev] Generic rules extensions for PHPStan
- phpstan/extension-installer: [--dev] Composer plugin for automatic installation of PHPStan extensions
- phpstan/phpstan: [--dev] PHPStan - PHP Static Analysis Tool
- phpstan/phpstan-beberlei-assert: [--dev] PHPStan beberlei/assert extension
- phpstan/phpstan-deprecation-rules: [--dev] PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits
- phpstan/phpstan-phpunit: [--dev] PHPUnit extensions and rules for PHPStan
- phpstan/phpstan-strict-rules: [--dev] Extra strict and opinionated rules for PHPStan
- thecodingmachine/phpstan-safe-rule: [--dev] A PHPStan rule to be used with the thecodingmachine/safe package
- thecodingmachine/phpstan-strict-rules: [--dev] A set of additional rules for PHPStan based on best practices followed at TheCodingMachine
- thecodingmachine/safe: All PHP functions, rewritten to throw exceptions instead of returning false
This package is auto-updated.
Last update: 2024-09-10 07:05:07 UTC
README
兼容PHP版本 7.4
、8.0
、8.1
、8.2
和 8.3
。
包含的工具
可选工具
安装
composer require --dev fox91/dev-tools
配置示例
将以下代码添加到您的 composer.json
文件中
"scripts": { "cs-e:test": "phpcs --colors -n", "cs:fix": "phpcbf --colors", "cs:test": "phpcs --colors", "lint:test": "parallel-lint --no-progress --blame --exclude vendor .", "phpstan:test": "phpstan analyse --no-progress --ansi --memory-limit 128M", "psalm:test": "psalm --no-progress --stats --show-info=true --show-snippet", "rector:fix": "rector --ansi process --no-progress-bar", "rector:test": "rector --ansi process --dry-run --no-progress-bar", "unit:test": "phpunit", "fix": [ "@rector:fix", "@cs:fix" ], "test": [ "@lint:test", "@rector:test", "@cs:test", "@psalm:test", "@unit:test" ] }, "scripts-descriptions": { "cs-e:test": "Run PHP_CodeSniffer tests, show only errors", "cs:fix": "Run PHP_CodeSniffer fixes", "cs:test": "Run PHP_CodeSniffer tests", "fix": "Run all fixes!", "lint:test": "Run PHP Parallel Lint tests", "phpstan:test": "Run PHPStan tests", "psalm:test": "Run Psalm tests", "rector:fix": "Run Rector fixes", "rector:test": "Run Rector tests", "test": "Run all tests!", "unit:test": "Run PHPUnit tests" }
将默认配置复制到您项目的根目录
cp \
vendor/fox91/dev-tools/configs/.editorconfig \
vendor/fox91/dev-tools/configs/.gitignore \
vendor/fox91/dev-tools/configs/.phpcs.xml.dist \
vendor/fox91/dev-tools/configs/gitattributes.txt \
vendor/fox91/dev-tools/configs/phpdoc.dist.xml \
vendor/fox91/dev-tools/configs/phpstan.neon.dist \
vendor/fox91/dev-tools/configs/phpunit.xml.dist \
vendor/fox91/dev-tools/configs/psalm.xml.dist \
vendor/fox91/dev-tools/configs/rector.php \
.
mv gitattributes.txt .gitattributes
使用方法
composer test docker run --rm -v "$(pwd)":/data:rw phpdoc/phpdoc run