File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 66use ArrayObject ;
77use Closure ;
88use Countable ;
9+ use DateTimeInterface ;
910use Iterator ;
1011use IteratorAggregate ;
1112use PHPStan \Analyser \OutOfClassScope ;
@@ -735,7 +736,6 @@ public function isEnum(): TrinaryLogic
735736 if (
736737 $ classReflection ->isEnum ()
737738 || $ classReflection ->is ('UnitEnum ' )
738- || $ classReflection ->is ('BackedEnum ' )
739739 ) {
740740 return TrinaryLogic::createYes ();
741741 }
@@ -744,6 +744,7 @@ public function isEnum(): TrinaryLogic
744744 $ classReflection ->isInterface ()
745745 && !$ classReflection ->is (Stringable::class) // enums cannot have __toString
746746 && !$ classReflection ->is (Throwable::class) // enums cannot extend Exception/Error
747+ && !$ classReflection ->is (DateTimeInterface::class) // userland classes cannot extend DateTimeInterface
747748 ) {
748749 return TrinaryLogic::createMaybe ();
749750 }
You can’t perform that action at this time.
0 commit comments