-
Notifications
You must be signed in to change notification settings - Fork 530
cover ExtendedMethodReflection by bc-promise #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
use function array_merge; | ||
use function count; | ||
|
||
/** | ||
* @api | ||
*/ | ||
class Assertions | ||
{ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
use PHPStan\Rules\Rule; | ||
use PHPStan\Rules\RuleError; | ||
use PHPStan\Rules\RuleErrorBuilder; | ||
use PHPStan\Type\Type; | ||
use function array_merge; | ||
use function count; | ||
use function in_array; | ||
|
@@ -66,10 +65,7 @@ private function checkName(Scope $scope, Node\Name $name): array | |
'https://github.com/phpstan/phpstan/discussions', | ||
))->build(); | ||
|
||
if (in_array($extendedInterfaceReflection->getName(), [ | ||
Type::class, | ||
ReflectionProvider::class, | ||
], true)) { | ||
if (in_array($extendedInterfaceReflection->getName(), BcUncoveredInterface::CLASSES, true)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am re-using the same constant as in since we are now ignoring 5 classes here instead of only 2, I could add more tests. |
||
return [$ruleError]; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Rules\Api; | ||
|
||
use PHPStan\Analyser\Scope; | ||
use PHPStan\Reflection\ExtendedMethodReflection; | ||
use PHPStan\Reflection\FunctionReflection; | ||
use PHPStan\Reflection\ReflectionProvider; | ||
use PHPStan\Type\Type; | ||
|
||
final class BcUncoveredInterface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A food for thought - in the future we could add a new annotation like |
||
{ | ||
|
||
public const CLASSES = [ | ||
Type::class, | ||
ReflectionProvider::class, | ||
Scope::class, | ||
FunctionReflection::class, | ||
ExtendedMethodReflection::class, | ||
]; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above this interface is this big comment, mentioning that this interface is not meant for re-use. I guess it should be dropped now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll rewrite it after merge.