-
Notifications
You must be signed in to change notification settings - Fork 133
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
Fixed hooks parameters and return types #1466
Conversation
723c669
to
ab81459
Compare
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.
🚢 thanks @kukulich!
private array $parameters; | ||
protected array $parameters; | ||
|
||
/** @psalm-allow-private-mutation */ | ||
private bool $returnsReference; | ||
|
||
/** @psalm-allow-private-mutation */ | ||
private ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType|null $returnType; | ||
protected ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType|null $returnType; |
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.
Not a fan of using protected
(plus a trait), so we may really need to do some changing here in the next versions.
#[DataProvider('getPropertyHookReturnTypeProvider')] | ||
public function testGetPropertyHookReturnType(string $propertyName, string|null $returnType): void | ||
{ | ||
$reflector = new DefaultReflector(new SingleFileSourceLocator(__DIR__ . '/../Fixture/PropertyHooks.php', $this->astLocator)); |
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.
One note on the design of these tests: having everything inside a third-party file makes them a bit harder to locate when jumping around source, compared to using a string locator inlined with the test
Just another bug found by @ondrejmirtes