diff --git a/phpstan.neon b/phpstan.neon index 7a1b1e49df5..125b5d8186f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -375,7 +375,6 @@ parameters: # internal tag - '#Unknown PHPDoc tag\: @phpstan\-rule#' - - '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is 14, keep it under 10#' # many internal cases - '#Calling (.*?) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version#' @@ -595,7 +594,8 @@ parameters: # resolve later to collector - - message: '#Class cognitive complexity is 55, keep it under 50#' - path: rules/TypeDeclaration/PHPStan/Type/ObjectTypeSpecifier.php + message: '#Class cognitive complexity is \d+, keep it under 50#' + path: rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php - - '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\Type\\ObjectTypeSpecifier\:\:narrowToFullyQualifiedOrAliasedObjectType\(\)" is \d+, keep it under 10#' + - '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\ObjectTypeSpecifier\:\:matchShortenedObjectType\(\)" is \d+, keep it under 10#' + - '#Cognitive complexity for "Rector\\TypeDeclaration\\PHPStan\\ObjectTypeSpecifier\:\:narrowToFullyQualifiedOrAliasedObjectType\(\)" is \d+, keep it under 10#' diff --git a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_exist.php.inc b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_exist.php.inc index 78df6e8412c..1a5fa311b33 100644 --- a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_exist.php.inc +++ b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_exist.php.inc @@ -30,10 +30,10 @@ class ClassExists { public function run() { - return new Anonymous__8012caaa6db2848028c58729537f4951__0(); + return new Anonymous__%s__0(); } } -class Anonymous__8012caaa6db2848028c58729537f4951__0 +class Anonymous__%s__0 { public function execute() { diff --git a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_in_trait.php.inc b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_in_trait.php.inc index 7863841ba09..2965c4e5937 100644 --- a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_in_trait.php.inc +++ b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/class_in_trait.php.inc @@ -26,14 +26,14 @@ trait ClassInTrait { $message = 'error'; - $first = new Anonymous__3e394521acb7827bb92d281feff1e6ff__0($message); + $first = new Anonymous__%s__0($message); - $second = new Anonymous__3e394521acb7827bb92d281feff1e6ff__1(); + $second = new Anonymous__%s__1(); } } -class Anonymous__3e394521acb7827bb92d281feff1e6ff__0 extends \InvalidArgumentException +class Anonymous__%s__0 extends \InvalidArgumentException { } -class Anonymous__3e394521acb7827bb92d281feff1e6ff__1 extends \Exception +class Anonymous__%s__1 extends \Exception { } diff --git a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/fixture.php.inc b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/fixture.php.inc index 4fe70a086e0..e76f5e76bed 100644 --- a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/fixture.php.inc +++ b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/fixture.php.inc @@ -24,10 +24,10 @@ class Fixture { public function run() { - return new Anonymous__4ca3de28f19d52cd0bb75d0880ce939c__0(); + return new Anonymous__%s__0(); } } -class Anonymous__4ca3de28f19d52cd0bb75d0880ce939c__0 +class Anonymous__%s__0 { public function execute() { diff --git a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure.php.inc b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure.php.inc index 40c4bd0d96a..a0a46835686 100644 --- a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure.php.inc +++ b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure.php.inc @@ -17,9 +17,9 @@ function () { namespace Rector\Tests\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector\Fixture; function () { - return new Anonymous__d746a33921816ede30ef66b0a30f1039__0(); + return new Anonymous__%s__0(); }; -class Anonymous__d746a33921816ede30ef66b0a30f1039__0 +class Anonymous__%s__0 { public function execute() { diff --git a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure_no_namespace.php.inc b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure_no_namespace.php.inc index 154351b5028..0003d3ba57f 100644 --- a/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure_no_namespace.php.inc +++ b/rules-tests/DowngradePhp70/Rector/New_/DowngradeAnonymousClassRector/Fixture/in_closure_no_namespace.php.inc @@ -13,9 +13,9 @@ function () {