Skip to content

Commit 65bf4ac

Browse files
committed
Use static keyword instead of get_called_class() for performance reason
1 parent e7b987d commit 65bf4ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MabeEnum/Enum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ final public function is($enum)
147147
final public static function get($value, $tradeExtendedAsUnknown = true)
148148
{
149149
if ($value instanceof static) {
150-
if ($tradeExtendedAsUnknown && !defined(get_called_class() . '::' . $value->getName())) {
150+
if ($tradeExtendedAsUnknown && !defined('static::' . $value->getName())) {
151151
throw new InvalidArgumentException(sprintf(
152152
"%s::%s is not inherited from %s",
153153
get_class($value),

0 commit comments

Comments
 (0)