diff --git a/README.md b/README.md index 6237d45..16cc15a 100644 --- a/README.md +++ b/README.md @@ -71,16 +71,21 @@ local PHP, Composer and database), or you can use ### Development tools: Composer, PHIVE and dependency hell -Most development tools (e.g., PHP_CodeSniffer) are installed with -[PHIVE](https://phar.io/), not with Composer. PHIVE packages each tool with all -its dependencies as a separate PHAR. This helps avoid dependency hell (which -means that you cannot install or upgrade some tool as the tool's dependencies -conflict with the dependencies on another library). It also allows running -versions of tools that require a PHP version that is higher than the lowest -allowed PHP version for this project. +To keep things simple, most development tools (e.g., PHP_CodeSniffer) are +installed as development Composer dependencies. -Some tools are not available via PHIVE, e.g., the Nimut testing framework or -the JSON linter. For these tools, we keep using Composer for the time being. +For cases where an installation via Composer is not possible, we are using +[PHIVE](https://phar.io/). PHIVE packages each tool with all its dependencies as +a separate PHAR. This helps avoid dependency hell (which means that you cannot +install or upgrade some tool as the tool's dependencies conflict with the +dependencies on another library). It also allows running versions of tools +that require a PHP version that is higher than the lowest allowed PHP version +for this project. + +Currently, this is the case for +[PHP Copy/Paste Detector (PHPCPD)](https://github.com/sebastianbergmann/phpcpd), +which requires PHP >= 7.3, which conflicts with this project's PHP version +support (we also support PHP 7.2). ### Running the code quality checks locally and in a CI environment diff --git a/composer.json b/composer.json index ec26e9b..60c4b39 100644 --- a/composer.json +++ b/composer.json @@ -36,10 +36,20 @@ }, "require-dev": { "codeception/codeception": "^4.1.5", + "ergebnis/composer-normalize": "^2.15", + "friendsofphp/php-cs-fixer": "^2.19.2", "helhum/typo3-composer-setup": "^0.5.7", + "helmich/typo3-typoscript-lint": "^2.5", + "jangregor/phpstan-prophecy": "^0.8.1", "nimut/testing-framework": "^5.0.3", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^0.12.96", + "phpstan/phpstan-phpunit": "^0.12.22", "phpunit/phpunit": "^7.5.20", + "saschaegerer/phpstan-typo3": "^0.13.3", "seld/jsonlint": "^1.8", + "squizlabs/php_codesniffer": "^3.6", + "symfony/yaml": "^4.4 || ^5.3", "typo3/cms-fluid-styled-content": "^9.5 || ^10.4" }, "config": { @@ -76,7 +86,7 @@ "ci": [ "@ci:static" ], - "ci:composer:normalize": "@php ./tools/composer-normalize --dry-run", + "ci:composer:normalize": "@composer normalize --dry-run", "ci:dynamic": [ "@ci:tests" ], @@ -89,10 +99,10 @@ "@ci:php:stan" ], "ci:php:copypaste": "@php ./tools/phpcpd Classes Configuration Tests", - "ci:php:cs-fixer": "@php ./tools/php-cs-fixer fix --config .php_cs.php -v --dry-run --using-cache false --diff --diff-format=udiff", + "ci:php:cs-fixer": "php-cs-fixer fix --config .php_cs.php -v --dry-run --using-cache false --diff --diff-format=udiff", "ci:php:lint": "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l", - "ci:php:sniff": "@php ./tools/phpcs Classes Configuration Tests", - "ci:php:stan": "@php ./tools/phpstan analyse Classes", + "ci:php:sniff": "phpcs Classes Configuration Tests", + "ci:php:stan": "phpstan analyse Classes", "ci:static": [ "@ci:composer:normalize", "@ci:json:lint", @@ -110,8 +120,8 @@ ], "ci:tests:functional": "find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo \"Running functional test suite {}\"; .Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml {}';", "ci:tests:unit": ".Build/vendor/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit", - "ci:ts:lint": "@php ./tools/typo3-typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", - "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.yml' | xargs php ./tools/yaml-lint", + "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", + "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*Resources/Private/node_modules/*' -name '*.yml' | xargs php ./.Build/vendor/bin/yaml-lint", "docs:generate": [ "docker run --rm t3docs/render-documentation show-shell-commands > tempfile.sh; echo 'dockrun_t3rd makehtml' >> tempfile.sh; bash tempfile.sh; rm tempfile.sh" ], @@ -119,8 +129,8 @@ "@fix:php:cs", "@fix:php:sniff" ], - "fix:php:cs": "@php ./tools/php-cs-fixer fix --config .php_cs.php", - "fix:php:sniff": "@php ./tools/phpcbf Classes Configuration Tests", + "fix:php:cs": "php-cs-fixer fix --config .php_cs.php", + "fix:php:sniff": "phpcbf Classes Configuration Tests", "link-extension": [ "@php -r 'is_dir($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/\") || mkdir($extFolder, 0777, true);'", "@php -r 'file_exists($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/tea\") || symlink(__DIR__,$extFolder);'" diff --git a/phive.xml b/phive.xml index c9bb012..c809e03 100644 --- a/phive.xml +++ b/phive.xml @@ -2,11 +2,4 @@ - - - - - - - diff --git a/tools/composer-normalize b/tools/composer-normalize deleted file mode 100755 index 3eb8b72..0000000 Binary files a/tools/composer-normalize and /dev/null differ diff --git a/tools/php-cs-fixer b/tools/php-cs-fixer deleted file mode 100755 index d579151..0000000 Binary files a/tools/php-cs-fixer and /dev/null differ diff --git a/tools/phpcbf b/tools/phpcbf deleted file mode 100755 index dcf50ad..0000000 Binary files a/tools/phpcbf and /dev/null differ diff --git a/tools/phpcs b/tools/phpcs deleted file mode 100755 index d253d18..0000000 Binary files a/tools/phpcs and /dev/null differ diff --git a/tools/phpstan b/tools/phpstan deleted file mode 100755 index dea3d16..0000000 Binary files a/tools/phpstan and /dev/null differ diff --git a/tools/typo3-typoscript-lint b/tools/typo3-typoscript-lint deleted file mode 100755 index 7647847..0000000 Binary files a/tools/typo3-typoscript-lint and /dev/null differ diff --git a/tools/yaml-lint b/tools/yaml-lint deleted file mode 100755 index c472cd8..0000000 Binary files a/tools/yaml-lint and /dev/null differ