File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,17 @@ public function __construct(public ?string $value = null, public bool $required
27
27
public function collectProperty (string $ className , ?string $ target ): void
28
28
{
29
29
try {
30
- $ reflectionClass = ReflectionManager::reflectClass ($ className );
30
+ if (is_null ($ this ->value )) {
31
+ $ reflectionClass = ReflectionManager::reflectClass ($ className );
31
32
32
- $ reflectionProperty = $ reflectionClass ->getProperty ($ target );
33
+ $ reflectionProperty = $ reflectionClass ->getProperty ($ target );
33
34
34
- if (method_exists ($ reflectionProperty , 'hasType ' ) && $ reflectionProperty ->hasType ()) {
35
- /* @phpstan-ignore-next-line */
36
- $ this ->value = $ reflectionProperty ->getType ()->getName ();
37
- } else {
38
- $ this ->value = PhpDocReaderManager::getInstance ()->getPropertyClass ($ reflectionProperty );
35
+ if (method_exists ($ reflectionProperty , 'hasType ' ) && $ reflectionProperty ->hasType ()) {
36
+ /* @phpstan-ignore-next-line */
37
+ $ this ->value = $ reflectionProperty ->getType ()->getName ();
38
+ } else {
39
+ $ this ->value = PhpDocReaderManager::getInstance ()->getPropertyClass ($ reflectionProperty );
40
+ }
39
41
}
40
42
41
43
if (empty ($ this ->value )) {
You can’t perform that action at this time.
0 commit comments