FIX: ignore enumeration duplicities with null as key
This commit is contained in:
@@ -47,7 +47,7 @@ abstract class BaseEnumeration
|
|||||||
public static function push($key, $translation, $overwrite = false)
|
public static function push($key, $translation, $overwrite = false)
|
||||||
{
|
{
|
||||||
// item exists and we do not want to overwrite items
|
// item exists and we do not want to overwrite items
|
||||||
if (!$overwrite && isset(self::$items[get_called_class()][$key])) {
|
if (!$overwrite && !is_null($key) && isset(self::$items[get_called_class()][$key])) {
|
||||||
throw new EnumerationExistsException(get_called_class() . ': ' . $key . ' already in ' . $translation);
|
throw new EnumerationExistsException(get_called_class() . ': ' . $key . ' already in ' . $translation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user