From fd94e2245acff5cd2ab15a920ed641876ede0eaa Mon Sep 17 00:00:00 2001 From: Pen-y-Fan <40126936+Pen-y-Fan@users.noreply.github.com> Date: Tue, 23 Feb 2021 00:42:28 +0000 Subject: [PATCH] Available list converted to table with matrix **Removed tools**, manually updated to table for consistency. **devkit.php** updated to automatically generate the, github flavored markdown table, based on tags: - exclude-php:7.3 - exclude-php:7.4 - exclude-php:8.0 --- README.md | 158 +++++++++++++++++++++++++------------------------ bin/devkit.php | 19 ++++-- 2 files changed, 96 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index e93816b2..93069647 100644 --- a/README.md +++ b/README.md @@ -14,86 +14,90 @@ It has been extracted as a separate project to make maintenance easier and enabl ## Available tools -* analyze - [Visualizes metrics and source code](https://github.com/Qafoo/QualityAnalyzer) -* behat - [Helps to test business expectations](http://behat.org/) -* box - [Fast, zero config application bundler with PHARs](https://github.com/humbug/box) -* box-legacy - [Legacy version of box](https://box-project.github.io/box2/) -* churn - [Discovers good candidates for refactoring](https://github.com/bmitch/churn-php) -* composer - [Dependency Manager for PHP](https://getcomposer.org/) -* composer-bin-plugin - [Composer plugin to install bin vendors in isolated locations](https://github.com/bamarni/composer-bin-plugin) -* composer-normalize - [Composer plugin to normalize composer.json files](https://github.com/ergebnis/composer-normalize) -* composer-unused - [Show unused packages by scanning your code](https://github.com/icanhazstring/composer-unused) -* dephpend - [Detect flaws in your architecture](https://dephpend.com/) -* deprecation-detector - [Finds usages of deprecated code](https://github.com/sensiolabs-de/deprecation-detector) -* deptrac - [Enforces dependency rules between software layers](https://github.com/qossmic/deptrac) -* diffFilter - [Applies QA tools to run on a single pull request](https://github.com/exussum12/coverageChecker) -* doctrine-psalm-plugin - [Stubs to let Psalm understand Doctrine better](https://github.com/weirdan/doctrine-psalm-plugin) -* ecs - [Sets up and runs coding standard checks](https://github.com/Symplify/EasyCodingStandard) -* infection - [AST based PHP Mutation Testing Framework](https://infection.github.io/) -* larastan - [PHPStan extension for Laravel](https://github.com/nunomaduro/larastan) -* local-php-security-checker - [Checks composer dependencies for known security vulnerabilities](https://github.com/fabpot/local-php-security-checker) -* parallel-lint - [Checks PHP file syntax](https://github.com/JakubOnderka/PHP-Parallel-Lint) -* paratest - [Parallel testing for PHPUnit](https://github.com/paratestphp/paratest) -* pdepend - [Static Analysis Tool](https://pdepend.org/) -* phan - [Static Analysis Tool](https://github.com/phan/phan) -* php-coupling-detector - [Detects code coupling issues](https://akeneo.github.io/php-coupling-detector/) -* php-cs-fixer - [PHP Coding Standards Fixer](http://cs.sensiolabs.org/) -* php-formatter - [Custom coding standards fixer](https://github.com/mmoreram/php-formatter) -* php-semver-checker - [Suggests a next version according to semantic versioning](https://github.com/tomzx/php-semver-checker) -* phpa - [Checks for weak assumptions](https://github.com/rskuipers/php-assumptions) -* phpat - [Easy to use architecture testing tool](https://github.com/carlosas/phpat) -* phpbench - [PHP Benchmarking framework](https://github.com/phpbench/phpbench) -* phpca - [Finds usage of non-built-in extensions](https://github.com/wapmorgan/PhpCodeAnalyzer) -* phpcb - [PHP Code Browser](https://github.com/mayflower/PHP_CodeBrowser) -* phpcbf - [Automatically corrects coding standard violations](https://github.com/squizlabs/PHP_CodeSniffer) -* phpcodesniffer-composer-install - [Easy installation of PHP_CodeSniffer coding standards (rulesets).](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) -* phpcov - [a command-line frontend for the PHP_CodeCoverage library](https://github.com/sebastianbergmann/phpcov) -* phpcpd - [Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd) -* phpcs - [Detects coding standard violations](https://github.com/squizlabs/PHP_CodeSniffer) -* phpcs-security-audit - [Finds vulnerabilities and weaknesses related to security in PHP code](https://github.com/FloeDesignTechnologies/phpcs-security-audit) -* phpda - [Generates dependency graphs](https://mamuz.github.io/PhpDependencyAnalysis/) -* phpdd - [Finds usage of deprecated features](http://wapmorgan.github.io/PhpDeprecationDetector) -* phpdoc-to-typehint - [Automatically adds type hints and return types based on PHPDocs](https://github.com/dunglas/phpdoc-to-typehint) -* phpDocumentor - [Documentation generator](https://www.phpdoc.org/) -* phpinsights - [Analyses code quality, style, architecture and complexity](https://phpinsights.com/) -* phplint - [Lints php files in parallel](https://github.com/overtrue/phplint) -* phploc - [A tool for quickly measuring the size of a PHP project](https://github.com/sebastianbergmann/phploc) -* phpmd - [A tool for finding problems in PHP code](https://phpmd.org/) -* phpmetrics - [Static Analysis Tool](http://www.phpmetrics.org/) -* phpmnd - [Helps to detect magic numbers](https://github.com/povils/phpmnd) -* phpspec - [SpecBDD Framework](http://www.phpspec.net/) -* phpstan - [Static Analysis Tool](https://github.com/phpstan/phpstan) -* phpstan-beberlei-assert - [PHPStan extension for beberlei/assert](https://github.com/phpstan/phpstan-beberlei-assert) -* phpstan-deprecation-rules - [PHPStan rules for detecting deprecated code](https://github.com/phpstan/phpstan-deprecation-rules) -* phpstan-doctrine - [Doctrine extensions for PHPStan](https://github.com/phpstan/phpstan-doctrine) -* phpstan-ergebnis-rules - [Additional rules for PHPstan](https://github.com/ergebnis/phpstan-rules) -* phpstan-exception-rules - [PHPStan rules for checked and unchecked exceptions](https://github.com/pepakriz/phpstan-exception-rules) -* phpstan-larastan - [Separate installation of phpstan for larastan](https://github.com/phpstan/phpstan) -* phpstan-phpunit - [PHPUnit extensions and rules for PHPStan](https://github.com/phpstan/phpstan-phpunit) -* phpstan-strict-rules - [Extra strict and opinionated rules for PHPStan](https://github.com/phpstan/phpstan-strict-rules) -* phpstan-symfony - [Symfony extension for PHPStan](https://github.com/phpstan/phpstan-symfony) -* phpstan-webmozart-assert - [PHPStan extension for webmozart/assert](https://github.com/phpstan/phpstan-webmozart-assert) -* phpunit - [The PHP testing framework](https://phpunit.de/) -* phpunit-5 - [The PHP testing framework (5.x version)](https://phpunit.de/) -* phpunit-7 - [The PHP testing framework (7.x version)](https://phpunit.de/) -* phpunit-8 - [The PHP testing framework (8.x version)](https://phpunit.de/) -* psalm - [Finds errors in PHP applications](https://psalm.dev/) -* psecio-parse - [Scans code for potential security-related issues](https://github.com/psecio/parse) -* rector - [Tool for instant code upgrades and refactoring](https://github.com/rectorphp/rector) -* roave-backward-compatibility-check - [Tool to compare two revisions of a class API to check for BC breaks](https://github.com/Roave/BackwardCompatibilityCheck) -* simple-phpunit - [Provides utilities to report legacy tests and usage of deprecated code](https://symfony.com/doc/current/components/phpunit_bridge.html) -* twig-lint - [Standalone twig linter](https://github.com/asm89/twig-lint) -* twigcs - [The missing checkstyle for twig!](https://github.com/friendsoftwig/twigcs) -* yaml-lint - [Compact command line utility for checking YAML file syntax](https://github.com/j13k/yaml-lint) +| Name | Description | PHP 7.3 | PHP 7.4 | PHP 8.0 +| :--- | :---------- | :------ | :------ | :------ +| analyze | [Visualizes metrics and source code](https://github.com/Qafoo/QualityAnalyzer) | ✅ | ✅ | ❌ | +| behat | [Helps to test business expectations](http://behat.org/) | ✅ | ✅ | ✅ | +| box | [Fast, zero config application bundler with PHARs](https://github.com/humbug/box) | ✅ | ✅ | ❌ | +| box-legacy | [Legacy version of box](https://box-project.github.io/box2/) | ✅ | ✅ | ✅ | +| churn | [Discovers good candidates for refactoring](https://github.com/bmitch/churn-php) | ✅ | ✅ | ✅ | +| composer | [Dependency Manager for PHP](https://getcomposer.org/) | ✅ | ✅ | ✅ | +| composer-bin-plugin | [Composer plugin to install bin vendors in isolated locations](https://github.com/bamarni/composer-bin-plugin) | ✅ | ✅ | ✅ | +| composer-normalize | [Composer plugin to normalize composer.json files](https://github.com/ergebnis/composer-normalize) | ✅ | ✅ | ✅ | +| composer-unused | [Show unused packages by scanning your code](https://github.com/icanhazstring/composer-unused) | ✅ | ✅ | ✅ | +| dephpend | [Detect flaws in your architecture](https://dephpend.com/) | ✅ | ✅ | ✅ | +| deprecation-detector | [Finds usages of deprecated code](https://github.com/sensiolabs-de/deprecation-detector) | ✅ | ✅ | ✅ | +| deptrac | [Enforces dependency rules between software layers](https://github.com/qossmic/deptrac) | ✅ | ✅ | ✅ | +| diffFilter | [Applies QA tools to run on a single pull request](https://github.com/exussum12/coverageChecker) | ✅ | ✅ | ❌ | +| doctrine-psalm-plugin | [Stubs to let Psalm understand Doctrine better](https://github.com/weirdan/doctrine-psalm-plugin) | ✅ | ✅ | ❌ | +| ecs | [Sets up and runs coding standard checks](https://github.com/Symplify/EasyCodingStandard) | ✅ | ✅ | ✅ | +| infection | [AST based PHP Mutation Testing Framework](https://infection.github.io/) | ❌ | ✅ | ✅ | +| larastan | [PHPStan extension for Laravel](https://github.com/nunomaduro/larastan) | ✅ | ✅ | ✅ | +| local-php-security-checker | [Checks composer dependencies for known security vulnerabilities](https://github.com/fabpot/local-php-security-checker) | ✅ | ✅ | ✅ | +| parallel-lint | [Checks PHP file syntax](https://github.com/JakubOnderka/PHP-Parallel-Lint) | ✅ | ✅ | ❌ | +| paratest | [Parallel testing for PHPUnit](https://github.com/paratestphp/paratest) | ✅ | ✅ | ❌ | +| pdepend | [Static Analysis Tool](https://pdepend.org/) | ✅ | ✅ | ✅ | +| phan | [Static Analysis Tool](https://github.com/phan/phan) | ✅ | ✅ | ✅ | +| php-coupling-detector | [Detects code coupling issues](https://akeneo.github.io/php-coupling-detector/) | ✅ | ✅ | ❌ | +| php-cs-fixer | [PHP Coding Standards Fixer](http://cs.sensiolabs.org/) | ✅ | ✅ | ✅ | +| php-formatter | [Custom coding standards fixer](https://github.com/mmoreram/php-formatter) | ✅ | ✅ | ❌ | +| php-semver-checker | [Suggests a next version according to semantic versioning](https://github.com/tomzx/php-semver-checker) | ✅ | ✅ | ✅ | +| phpa | [Checks for weak assumptions](https://github.com/rskuipers/php-assumptions) | ✅ | ✅ | ✅ | +| phpat | [Easy to use architecture testing tool](https://github.com/carlosas/phpat) | ✅ | ✅ | ❌ | +| phpbench | [PHP Benchmarking framework](https://github.com/phpbench/phpbench) | ✅ | ✅ | ✅ | +| phpca | [Finds usage of non-built-in extensions](https://github.com/wapmorgan/PhpCodeAnalyzer) | ✅ | ✅ | ✅ | +| phpcb | [PHP Code Browser](https://github.com/mayflower/PHP_CodeBrowser) | ✅ | ✅ | ✅ | +| phpcbf | [Automatically corrects coding standard violations](https://github.com/squizlabs/PHP_CodeSniffer) | ✅ | ✅ | ✅ | +| phpcodesniffer-composer-install | [Easy installation of PHP_CodeSniffer coding standards (rulesets).](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) | ✅ | ✅ | ✅ | +| phpcov | [a command-line frontend for the PHP_CodeCoverage library](https://github.com/sebastianbergmann/phpcov) | ✅ | ✅ | ✅ | +| phpcpd | [Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd) | ✅ | ✅ | ✅ | +| phpcs | [Detects coding standard violations](https://github.com/squizlabs/PHP_CodeSniffer) | ✅ | ✅ | ✅ | +| phpcs-security-audit | [Finds vulnerabilities and weaknesses related to security in PHP code](https://github.com/FloeDesignTechnologies/phpcs-security-audit) | ✅ | ✅ | ✅ | +| phpda | [Generates dependency graphs](https://mamuz.github.io/PhpDependencyAnalysis/) | ✅ | ✅ | ✅ | +| phpdd | [Finds usage of deprecated features](http://wapmorgan.github.io/PhpDeprecationDetector) | ✅ | ✅ | ✅ | +| phpdoc-to-typehint | [Automatically adds type hints and return types based on PHPDocs](https://github.com/dunglas/phpdoc-to-typehint) | ✅ | ✅ | ✅ | +| phpDocumentor | [Documentation generator](https://www.phpdoc.org/) | ✅ | ✅ | ❌ | +| phpinsights | [Analyses code quality, style, architecture and complexity](https://phpinsights.com/) | ✅ | ✅ | ❌ | +| phplint | [Lints php files in parallel](https://github.com/overtrue/phplint) | ✅ | ✅ | ✅ | +| phploc | [A tool for quickly measuring the size of a PHP project](https://github.com/sebastianbergmann/phploc) | ✅ | ✅ | ✅ | +| phpmd | [A tool for finding problems in PHP code](https://phpmd.org/) | ✅ | ✅ | ✅ | +| phpmetrics | [Static Analysis Tool](http://www.phpmetrics.org/) | ✅ | ✅ | ✅ | +| phpmnd | [Helps to detect magic numbers](https://github.com/povils/phpmnd) | ✅ | ✅ | ❌ | +| phpspec | [SpecBDD Framework](http://www.phpspec.net/) | ✅ | ✅ | ✅ | +| phpstan | [Static Analysis Tool](https://github.com/phpstan/phpstan) | ✅ | ✅ | ✅ | +| phpstan-beberlei-assert | [PHPStan extension for beberlei/assert](https://github.com/phpstan/phpstan-beberlei-assert) | ✅ | ✅ | ✅ | +| phpstan-deprecation-rules | [PHPStan rules for detecting deprecated code](https://github.com/phpstan/phpstan-deprecation-rules) | ✅ | ✅ | ✅ | +| phpstan-doctrine | [Doctrine extensions for PHPStan](https://github.com/phpstan/phpstan-doctrine) | ✅ | ✅ | ✅ | +| phpstan-ergebnis-rules | [Additional rules for PHPstan](https://github.com/ergebnis/phpstan-rules) | ✅ | ✅ | ✅ | +| phpstan-exception-rules | [PHPStan rules for checked and unchecked exceptions](https://github.com/pepakriz/phpstan-exception-rules) | ✅ | ✅ | ✅ | +| phpstan-larastan | [Separate installation of phpstan for larastan](https://github.com/phpstan/phpstan) | ✅ | ✅ | ✅ | +| phpstan-phpunit | [PHPUnit extensions and rules for PHPStan](https://github.com/phpstan/phpstan-phpunit) | ✅ | ✅ | ✅ | +| phpstan-strict-rules | [Extra strict and opinionated rules for PHPStan](https://github.com/phpstan/phpstan-strict-rules) | ✅ | ✅ | ✅ | +| phpstan-symfony | [Symfony extension for PHPStan](https://github.com/phpstan/phpstan-symfony) | ✅ | ✅ | ✅ | +| phpstan-webmozart-assert | [PHPStan extension for webmozart/assert](https://github.com/phpstan/phpstan-webmozart-assert) | ✅ | ✅ | ✅ | +| phpunit | [The PHP testing framework](https://phpunit.de/) | ✅ | ✅ | ✅ | +| phpunit-5 | [The PHP testing framework (5.x version)](https://phpunit.de/) | ✅ | ✅ | ❌ | +| phpunit-7 | [The PHP testing framework (7.x version)](https://phpunit.de/) | ✅ | ✅ | ❌ | +| phpunit-8 | [The PHP testing framework (8.x version)](https://phpunit.de/) | ✅ | ✅ | ✅ | +| psalm | [Finds errors in PHP applications](https://psalm.dev/) | ✅ | ✅ | ✅ | +| psecio-parse | [Scans code for potential security-related issues](https://github.com/psecio/parse) | ✅ | ✅ | ✅ | +| rector | [Tool for instant code upgrades and refactoring](https://github.com/rectorphp/rector) | ✅ | ✅ | ❌ | +| roave-backward-compatibility-check | [Tool to compare two revisions of a class API to check for BC breaks](https://github.com/Roave/BackwardCompatibilityCheck) | ❌ | ✅ | ❌ | +| simple-phpunit | [Provides utilities to report legacy tests and usage of deprecated code](https://symfony.com/doc/current/components/phpunit_bridge.html) | ✅ | ✅ | ✅ | +| twig-lint | [Standalone twig linter](https://github.com/asm89/twig-lint) | ✅ | ✅ | ✅ | +| twigcs | [The missing checkstyle for twig!](https://github.com/friendsoftwig/twigcs) | ✅ | ✅ | ✅ | +| yaml-lint | [Compact command line utility for checking YAML file syntax](https://github.com/j13k/yaml-lint) | ✅ | ✅ | ✅ | ### Removed tools -* composer-normalize - [Composer plugin to normalize composer.json files](https://github.com/localheinz/composer-normalize) -* design-pattern - [Detects design patterns](https://github.com/Halleck45/DesignPatternDetector) -* phpcf - [Finds usage of deprecated features](http://wapmorgan.github.io/PhpCodeFixer/) -* phpstan-localheinz-rules - [Additional rules for PHPstan](https://github.com/localheinz/phpstan-rules) -* security-checker - [Checks composer dependencies for known security vulnerabilities](https://github.com/sensiolabs/security-checker) -* testability - [Analyses and reports testability issues of a php codebase](https://github.com/edsonmedina/php_testability) +| Name | Summary | +| :--- | :------ | +| composer-normalize | [Composer plugin to normalize composer.json files](https://github.com/localheinz/composer-normalize) | +| design-pattern | [Detects design patterns](https://github.com/Halleck45/DesignPatternDetector) | +| phpcf | [Finds usage of deprecated features](http://wapmorgan.github.io/PhpCodeFixer/) | +| phpstan-localheinz-rules | [Additional rules for PHPstan](https://github.com/localheinz/phpstan-rules) | +| security-checker | [Checks composer dependencies for known security vulnerabilities](https://github.com/sensiolabs/security-checker) | +| testability | [Analyses and reports testability issues of a php codebase](https://github.com/edsonmedina/php_testability) | ## Installation diff --git a/bin/devkit.php b/bin/devkit.php index 586c0054..8948c731 100755 --- a/bin/devkit.php +++ b/bin/devkit.php @@ -72,10 +72,21 @@ protected function execute(InputInterface $input, OutputInterface $output) $jsonPath = $input->getOption('tools'); $readmePath = $input->getOption('readme'); $tools = $this->loadTools($jsonPath); - $toolsList = $tools->sort(function (Tool $left, Tool $right) { + + $toolsList = '| Name | Description | PHP 7.3 | PHP 7.4 | PHP 8.0' . PHP_EOL; + $toolsList .= '| :--- | :---------- | :------ | :------ | :------' . PHP_EOL; + $toolsList .= $tools->sort(function (Tool $left, Tool $right) { return strcasecmp($left->name(), $right->name()); })->reduce('', function ($acc, Tool $tool) { - return $acc . sprintf('* %s - [%s](%s)', $tool->name(), $tool->summary(), $tool->website()) . PHP_EOL; + + return $acc . sprintf('| %s | [%s](%s) | %s | %s | %s |', + $tool->name(), + $tool->summary(), + $tool->website(), + in_array('exclude-php:7.3', $tool->tags(), true) ? '❌' : '✅' , + in_array('exclude-php:7.4', $tool->tags(), true) ? '❌' : '✅' , + in_array('exclude-php:8.0', $tool->tags(), true) ? '❌' : '✅' + ) . PHP_EOL; }); $readme = file_get_contents($readmePath); @@ -162,8 +173,8 @@ function (string $phar) { $project = preg_replace('@https://[^/]*/([^/]*/[^/]*).*@', '$1', $phar); return strtr( - '-e "s@\"phar\": \"([^\"]*%PROJECT%[^\"]*)\"@\"phar\": \"%PHAR%\"@g"'. - ' '. + '-e "s@\"phar\": \"([^\"]*%PROJECT%[^\"]*)\"@\"phar\": \"%PHAR%\"@g"' . + ' ' . '-e "s@\"url\": \"([^\"]*%PROJECT%[^\"]*\.phar(\.asc|\.pubkey))\"@\"url\": \"%PHAR%\\2\"@g"', ['%PROJECT%' => $project, '%PHAR%' => $phar] );