Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions tests/Rules/Deprecations/CallToDeprecatedMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -59,7 +63,7 @@ public function testDeprecatedStaticMethodCall(): void
],
[
'Call to deprecated method deprecatedFoo() of class CheckDeprecatedStaticMethodCall\Foo.',
24,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! One more thing I need here is to actually add a test that checks that this scenario is continuted to be reported in a valid scenario, e.g. calling parent::deprecatedFoo(); in a scope that's not deprecated. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm ok. I will see if I can get that fixed. If not I will let you know

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood your post correctly, I think this has been added back in another way now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just that this extension is built with latest stable PHPStan version and not with dev-master. Update the composer.json for the purpose of this PR :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know that. I was referring to the actual meaning of your sentence 🤓

Anyway updates composer.json as well now

33,
],
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public static function deprecatedFoo()

}

class Bar3 extends Foo
{
public static function callOtherDeprecatedMethod()
{
parent::deprecatedFoo();
}
}

/**
* @deprecated
*/
Expand Down