diff --git a/src/Core/Entity.php b/src/Core/Entity.php index cf343d6c6b..7db4a39f40 100644 --- a/src/Core/Entity.php +++ b/src/Core/Entity.php @@ -40,7 +40,7 @@ abstract class Entity $private_property_accessor = $private_property_accessor->bindTo($this, get_called_class()); return $private_property_accessor($prop); } - throw new \Exception('Non existent method ' . get_called_class() . "::{$name} called with arguments: " . print_r($arguments, true)); + throw new \BadMethodCallException('Non existent method ' . get_called_class() . "::{$name} called with arguments: " . print_r($arguments, true)); } /** diff --git a/src/Core/Security.php b/src/Core/Security.php index 2f0db3aef5..95aed02a22 100644 --- a/src/Core/Security.php +++ b/src/Core/Security.php @@ -49,7 +49,11 @@ abstract class Security if (method_exists(self::$security, $name)) { return self::$security->{$name}(...$args); } else { - return self::$sanitizer->{$name}(...$args); + if (method_exists(self::$sanitizer, $name)) { + return self::$sanitizer->{$name}(...$args); + } else { + throw new \BadMethodCallException("Method Security::{$name} doesn't exist"); + } } } }