Closed garak closed 6 years ago
Hey @garak thank you for the issue! Yeah, seem that on abstract methods isn't possible to add type hint on the child class.
I guess we should just add the Enum
type hint on it. public function equals(Enum $enum): bool
If you have any other suggestion feel free to help, PR is welcome if you're free!
What about this?
public function equals(ReflectionEnum $enum): bool
{
return $this->value === $enum->getValue();
}
ReflectionEnum
is an implementation of the interface Enum
.
If we are going to type hint it I prefer using the interface, so custom implementation are will be supported 😄
@garak are you free to work on it? Otherwise, I'll schedule some time next week 😄
See #15
Ty @garak for improving this package!
I'm implementing ReflectionEnum, so I added the method:
Problem is I cannot really use
$enum->getValue()
, unless$enum
is type-hinted against ReflectionEnum