diff --git a/.gitattributes b/.gitattributes index 33ba7cd..633b2b3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,4 +15,5 @@ /phive.xml /phpcs.xml export-ignore /phpstan.neon export-ignore +/phpstan-baseline.neon export-ignore /tools/ export-ignore binary diff --git a/composer.json b/composer.json index b1104bb..5dc5503 100644 --- a/composer.json +++ b/composer.json @@ -104,7 +104,7 @@ "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": "phpcs Classes Configuration Tests", - "ci:php:stan": "phpstan analyse Classes", + "ci:php:stan": "phpstan --no-progress", "ci:static": [ "@ci:composer:normalize", "@ci:json:lint", @@ -137,6 +137,7 @@ "@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);'" ], + "phpstan:baseline": ".Build/vendor/bin/phpstan --generate-baseline=phpstan-baseline.neon", "prepare-release": [ "rm .gitignore", "rm -rf .Build", @@ -154,6 +155,8 @@ "rm Resources/Private/stylelint.config.js", "rm codeception.yml", "rm phive.xml", + "rm phpstan-baseline.neon", + "rm phpstan.neon", "rm phpcs.xml" ] }, @@ -177,7 +180,8 @@ "docs:generate": "Renders the extension ReST documentation.", "fix:php": "Runs all fixers for the PHP code.", "fix:php:cs": "Fixes the code style with PHP-CS-Fixer.", - "fix:php:sniff": "Fixes the code style with PHP_CodeSniffer." + "fix:php:sniff": "Fixes the code style with PHP_CodeSniffer.", + "phpstan:baseline": "Updates the PHPStan baseline file to match the code." }, "support": { "issues": "https://github.com/TYPO3-Documentation/tea/issues", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..364905f --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,2 @@ +parameters: + ignoreErrors: diff --git a/phpstan.neon b/phpstan.neon index 4989c54..56b09f5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,18 @@ +includes: + - phpstan-baseline.neon + parameters: - level: 3 - bootstrapFiles: - - .Build/vendor/autoload.php - scanDirectories: - - Classes - - Tests + parallel: + # Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI + maximumNumberOfProcesses: 5 + + level: 3 + + bootstrapFiles: + - .Build/vendor/autoload.php + + paths: + - Classes + + scanDirectories: + - Classes