Skip to content

Commit e61f39c

Browse files
committed
Merge branch 'master' of github.com:myclabs/php-enum into hotfix/ability-to-create-invalid-enums
Conflicts: src/Enum.php
2 parents f12b80a + 5fa55b5 commit e61f39c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Enum.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __toString()
8080
*/
8181
public static function keys()
8282
{
83-
return array_keys(static::toArray());
83+
return array_keys(self::toArray());
8484
}
8585

8686
/**
@@ -95,6 +95,7 @@ public static function toArray()
9595
$reflection = new \ReflectionClass($class);
9696
self::$cache[$class] = $reflection->getConstants();
9797
}
98+
9899
return self::$cache[$class];
99100
}
100101

@@ -130,8 +131,7 @@ public static function isValidKey($key)
130131
*/
131132
public static function search($value)
132133
{
133-
// TODO: Replace combine with self::toArray()
134-
return array_search($value, array_combine(self::keys(), self::toArray()), true);
134+
return array_search($value, self::toArray());
135135
}
136136

137137
/**

0 commit comments

Comments
 (0)