-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add missing proxy methods #348
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 |
---|---|---|
|
@@ -5,7 +5,9 @@ | |
namespace Doctrine\Persistence\Reflection; | ||
|
||
use BackedEnum; | ||
use ReflectionClass; | ||
use ReflectionProperty; | ||
use ReflectionType; | ||
use ReturnTypeWillChange; | ||
|
||
use function array_map; | ||
|
@@ -30,6 +32,44 @@ | |
$this->enumType = $enumType; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* @psalm-external-mutation-free | ||
*/ | ||
public function getDeclaringClass(): ReflectionClass | ||
{ | ||
return $this->originalReflectionProperty->getDeclaringClass(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* @psalm-external-mutation-free | ||
*/ | ||
public function getName(): string | ||
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. you should be adding the 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 tried it locally, to no avail, then noticed I still had Psalm 4, apparently because Psalm 5 is not compatible with php 8.3 yet, so I just tried pushing, and it doesn't work with Psalm 5 either. 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. 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. 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. Just |
||
{ | ||
return $this->originalReflectionProperty->getName(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* @psalm-external-mutation-free | ||
*/ | ||
public function getType(): ?ReflectionType | ||
{ | ||
return $this->originalReflectionProperty->getType(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getAttributes(?string $name = null, int $flags = 0): array | ||
{ | ||
return $this->originalReflectionProperty->getAttributes($name, $flags); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
|
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.
This should be solved by making EnumReflectionProperty generic on the class name, as done in the stubs for ReflectionProperty in Psalm and phpstan instead of adding it in the baseline IMO.
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 agree, but I'm not sure how I can make the type flow from the constructor to there 🤔 I think I'm supposed to leverage
ReflectionProperty
's template types, if there are some, but I don't know where to find their definitions.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.
hmm, apparently, Psalm makes ReflectionProperty generic but phpstan does not. So I'm not sure solving this one is actually possible.