diff --git a/contrib/validate-split-packages-phpstan.php b/contrib/validate-split-packages-phpstan.php index 03d3a40bd71..f8bfa91c2cd 100644 --- a/contrib/validate-split-packages-phpstan.php +++ b/contrib/validate-split-packages-phpstan.php @@ -38,6 +38,10 @@ } ksort($packages); +$mainJsonContent = file_get_contents(dirname(__FILE__, 2) . DS . 'composer.json'); +$mainJson = json_decode($mainJsonContent, true); +$composerCommand = 'composer require --dev phpstan/phpstan:' . $mainJson['require-dev']['phpstan/phpstan']; + $issues = []; foreach ($packages as $path => $package) { if (!file_exists($path . 'phpstan.neon.dist')) { @@ -45,7 +49,11 @@ } $exitCode = null; - exec('cd ' . $path . ' && composer install && vendor/bin/phpstan analyze ./', $output, $exitCode); + exec( + 'cd ' . $path . ' && ' . $composerCommand . ' && vendor/bin/phpstan analyze ./', + $output, + $exitCode + ); if ($exitCode !== 0) { $code = $exitCode; diff --git a/src/Database/composer.json b/src/Database/composer.json index 61e8f6ae850..38567ad0880 100644 --- a/src/Database/composer.json +++ b/src/Database/composer.json @@ -41,7 +41,6 @@ }, "require-dev": { "cakephp/i18n": "^5.0", - "cakephp/log": "^5.0", - "phpstan/phpstan": "1.12.0" + "cakephp/log": "^5.0" } } diff --git a/src/Datasource/composer.json b/src/Datasource/composer.json index 05d4619d56c..53a48c2de61 100644 --- a/src/Datasource/composer.json +++ b/src/Datasource/composer.json @@ -41,7 +41,6 @@ "require-dev": { "cakephp/cache": "^5.0", "cakephp/collection": "^5.0", - "cakephp/utility": "^5.0", - "phpstan/phpstan": "1.12.0" + "cakephp/utility": "^5.0" } } diff --git a/src/Http/composer.json b/src/Http/composer.json index c64e5d4a887..77017d00b04 100644 --- a/src/Http/composer.json +++ b/src/Http/composer.json @@ -59,7 +59,6 @@ "cakephp/console": "^5.0", "cakephp/orm": "^5.0", "cakephp/i18n": "^5.0", - "paragonie/csp-builder": "^2.3", - "phpstan/phpstan": "1.12.0" + "paragonie/csp-builder": "^2.3" } } diff --git a/src/ORM/composer.json b/src/ORM/composer.json index 93575e1ecab..ba931623c70 100644 --- a/src/ORM/composer.json +++ b/src/ORM/composer.json @@ -46,7 +46,6 @@ }, "require-dev": { "cakephp/cache": "^5.0", - "cakephp/i18n": "^5.0", - "phpstan/phpstan": "1.12.0" + "cakephp/i18n": "^5.0" } } diff --git a/src/Validation/composer.json b/src/Validation/composer.json index 76cbd879477..456ba422fc8 100644 --- a/src/Validation/composer.json +++ b/src/Validation/composer.json @@ -36,7 +36,6 @@ } }, "require-dev": { - "cakephp/i18n": "^5.0", - "phpstan/phpstan": "1.12.0" + "cakephp/i18n": "^5.0" } }