Skip to content

Commit

Permalink
Bugfix: Parent methods in extended EnumReflectionProperty didn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Feb 27, 2024
1 parent e7cf418 commit adaa894
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Persistence/Reflection/EnumReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function __construct(ReflectionProperty $originalReflectionProperty, stri
{
$this->originalReflectionProperty = $originalReflectionProperty;
$this->enumType = $enumType;
parent::__construct($originalReflectionProperty->class, $originalReflectionProperty->name);

Check failure on line 30 in src/Persistence/Reflection/EnumReflectionProperty.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.2)

Expected 1 line before "parent", found 0.
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public function testSetValidArrayValue(): void
self::assertSame(['H', 'D'], $reflProperty->getValue($object));
self::assertSame([Suit::Hearts, Suit::Diamonds], $object->suits);
}

public function testParentReflectionPropertyMethods(): void
{
$reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class);

self::assertIsArray($reflProperty->getAttributes());
self::assertIsInt($reflProperty->getModifiers());
}
}

class TypedEnumClass
Expand Down

0 comments on commit adaa894

Please sign in to comment.