From d63a144a56302f2161b00727081884f1a6b1c8d0 Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Sun, 21 Nov 2021 18:07:26 +0100 Subject: [PATCH 1/5] Fix assertions for phpstan master --- .../Rules/Deprecations/CallToDeprecatedMethodRuleTest.php | 4 ++++ .../Deprecations/CallToDeprecatedStaticMethodRuleTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/Rules/Deprecations/CallToDeprecatedMethodRuleTest.php b/tests/Rules/Deprecations/CallToDeprecatedMethodRuleTest.php index f660fad..839a333 100644 --- a/tests/Rules/Deprecations/CallToDeprecatedMethodRuleTest.php +++ b/tests/Rules/Deprecations/CallToDeprecatedMethodRuleTest.php @@ -23,6 +23,10 @@ public function testDeprecatedMethodCall(): void 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedMethodCall\Foo.', 7, ], + [ + 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedMethodCall\Bar.', + 10, + ], [ 'Call to deprecated method deprecatedFoo2() of class CheckDeprecatedMethodCall\Foo.', 11, diff --git a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php index 45a48f3..a8747cf 100644 --- a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php +++ b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php @@ -25,6 +25,10 @@ public function testDeprecatedStaticMethodCall(): void 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.', 6, ], + [ + 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Bar.', + 8, + ], [ 'Call to deprecated method deprecatedFoo2() of class CheckDeprecatedStaticMethodCall\Foo.', 9, @@ -57,10 +61,6 @@ public function testDeprecatedStaticMethodCall(): void "Call to deprecated method deprecatedWithDescription() of class CheckDeprecatedStaticMethodCall\Foo:\nThis is probably a singleton.", 16, ], - [ - 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.', - 24, - ], ] ); } From b6f6b40ea1abf4bdb5476a76a557f7d9d1e1fc02 Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Tue, 23 Nov 2021 16:16:31 +0100 Subject: [PATCH 2/5] Add back supported deprecation report in test --- .../Deprecations/CallToDeprecatedStaticMethodRuleTest.php | 4 ++++ .../data/call-to-deprecated-static-method.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php index a8747cf..3595d0e 100644 --- a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php +++ b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php @@ -61,6 +61,10 @@ public function testDeprecatedStaticMethodCall(): void "Call to deprecated method deprecatedWithDescription() of class CheckDeprecatedStaticMethodCall\Foo:\nThis is probably a singleton.", 16, ], + [ + "Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.", + 33, + ] ] ); } diff --git a/tests/Rules/Deprecations/data/call-to-deprecated-static-method.php b/tests/Rules/Deprecations/data/call-to-deprecated-static-method.php index 78f9b12..93e122c 100644 --- a/tests/Rules/Deprecations/data/call-to-deprecated-static-method.php +++ b/tests/Rules/Deprecations/data/call-to-deprecated-static-method.php @@ -26,6 +26,14 @@ public static function deprecatedFoo() } +class Bar3 extends Foo +{ + public static function callOtherDeprecatedMethod() + { + parent::deprecatedFoo(); + } +} + /** * @deprecated */ From e00ad8ff3b3b5cb705eb1d5fe9ce225f92cb2652 Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Tue, 23 Nov 2021 16:52:57 +0100 Subject: [PATCH 3/5] Use dev-master for testing for now --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d96f390..a2f0ccd 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0" + "phpstan/phpstan": "dev-master" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", From 3323fc6e4a0dfab368866da380b28e75eaad3db2 Mon Sep 17 00:00:00 2001 From: "Eirik S. Morland" Date: Tue, 23 Nov 2021 16:54:47 +0100 Subject: [PATCH 4/5] Code style --- .../Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php index 3595d0e..674af83 100644 --- a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php +++ b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php @@ -64,7 +64,7 @@ public function testDeprecatedStaticMethodCall(): void [ "Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.", 33, - ] + ], ] ); } From bc39b469a253bc05a2e12498451ee8fef27411bc Mon Sep 17 00:00:00 2001 From: Eirik Stanghelle Morland Date: Tue, 23 Nov 2021 18:25:56 +0100 Subject: [PATCH 5/5] Update CallToDeprecatedStaticMethodRuleTest.php --- .../Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php index 674af83..a1b2ff8 100644 --- a/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php +++ b/tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php @@ -62,7 +62,7 @@ public function testDeprecatedStaticMethodCall(): void 16, ], [ - "Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.", + 'Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.', 33, ], ]