Skip to content

Commit

Permalink
PropertyDescriptor - correctly resolve from reflection whether a prop…
Browse files Browse the repository at this point in the history
…erty is static or not
  • Loading branch information
ondrejmirtes committed Oct 18, 2020
1 parent 1893100 commit fadb439
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Rules/Properties/PropertyDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function describeProperty(PropertyReflection $property, $propertyFetch):
{
/** @var \PhpParser\Node\Identifier $name */
$name = $propertyFetch->name;
if ($propertyFetch instanceof \PhpParser\Node\Expr\PropertyFetch) {
if (!$property->isStatic()) {
return sprintf('Property %s::$%s', $property->getDeclaringClass()->getDisplayName(), $name->name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testTypesAssignedToProperties(): void
37,
],
[
'Static property PropertiesAssignedTypes\Ipsum::$parentStringProperty (string) does not accept int.',
'Property PropertiesAssignedTypes\Ipsum::$parentStringProperty (string) does not accept int.',
39,
],
[
Expand Down

0 comments on commit fadb439

Please sign in to comment.