Skip to content

Commit

Permalink
Исправлена область видимости переменной
Browse files Browse the repository at this point in the history
  • Loading branch information
mepihindeveloper authored Dec 7, 2021
1 parent 2609102 commit 5c27ce1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ public static function getMapValueByKey(string $key) {
throw new InvalidArgumentException("Ключ {$key} отсутствует.");
}

return self::$map[$key];
return static::$map[$key];
}

/**
* @inheritDoc
*/
public static function has(string $key): bool {
return array_key_exists($key, self::$map);
return array_key_exists($key, static::$map);
}

/**
* @inheritDoc
*/
public static function getMap(string $key = ''): array {
if (empty($key)) {
return self::$map;
return static::$map;
}

if (!self::has($key)) {
throw new InvalidArgumentException("Ключ {$key} отсутствует.");
}

return [$key => self::$map[$key]];
return [$key => static::$map[$key]];
}
}
}

0 comments on commit 5c27ce1

Please sign in to comment.