Skip to content

Commit

Permalink
Fix issue around generics and MethodsClassReflectionExtension/Propert…
Browse files Browse the repository at this point in the history
…iesClassReflectionExtension
  • Loading branch information
ondrejmirtes committed Oct 3, 2022
1 parent 8657382 commit c052aac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Type/ObjectType.php
Expand Up @@ -160,7 +160,7 @@ public function getUnresolvedPropertyPrototype(string $propertyName, ClassMember
throw new ClassNotFoundException($this->className);
}

if (!$nakedClassReflection->hasProperty($propertyName)) {
if (!$nakedClassReflection->hasNativeProperty($propertyName)) {
$nakedClassReflection = $this->getClassReflection();
}

Expand Down Expand Up @@ -642,7 +642,7 @@ public function getUnresolvedMethodPrototype(string $methodName, ClassMemberAcce
throw new ClassNotFoundException($this->className);
}

if (!$nakedClassReflection->hasMethod($methodName)) {
if (!$nakedClassReflection->hasNativeMethod($methodName)) {
$nakedClassReflection = $this->getClassReflection();
}

Expand Down

2 comments on commit c052aac

@canvural
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, this simple change will fix so many stuff in Larastan! 😄

@ondrejmirtes
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm surprised you can see that, this is pretty weird code with weird side effects :) But it fixed phpstan/phpstan#8008, so that's nice.

You can test this in Larastan in a moment, 1.8.7 is being released.

Please sign in to comment.