FIX: ignore enumeration duplicities with null as key

This commit is contained in:
Michal Kváček
2016-08-15 20:47:52 +02:00
parent 53d532da82
commit 5b79fd4323
+1 -1
View File
@@ -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);
} }