Replace deprecated trigger_error calls with exceptions

This commit is contained in:
2025-02-13 11:37:55 +01:00
parent 814a1f82f6
commit 85ed6ba8d3
7 changed files with 26 additions and 26 deletions

View File

@@ -24,7 +24,7 @@ class Registry
public static function get($key)
{
if (!isset(self::$storage[$key]))
trigger_error('Key does not exist in Registry: ' . $key, E_USER_ERROR);
throw new Exception('Key does not exist in Registry: ' . $key);
return self::$storage[$key];
}
@@ -32,7 +32,7 @@ class Registry
public static function remove($key)
{
if (!isset(self::$storage[$key]))
trigger_error('Key does not exist in Registry: ' . $key, E_USER_ERROR);
throw new Exception('Key does not exist in Registry: ' . $key);
unset(self::$storage[$key]);
}