[CORE] Throw more meaningfull error when method doesn't exist in Security and Entity
This commit is contained in:
parent
6d93b6fb32
commit
9198797aea
@ -40,7 +40,7 @@ abstract class Entity
|
|||||||
$private_property_accessor = $private_property_accessor->bindTo($this, get_called_class());
|
$private_property_accessor = $private_property_accessor->bindTo($this, get_called_class());
|
||||||
return $private_property_accessor($prop);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,7 +49,11 @@ abstract class Security
|
|||||||
if (method_exists(self::$security, $name)) {
|
if (method_exists(self::$security, $name)) {
|
||||||
return self::$security->{$name}(...$args);
|
return self::$security->{$name}(...$args);
|
||||||
} else {
|
} else {
|
||||||
|
if (method_exists(self::$sanitizer, $name)) {
|
||||||
return self::$sanitizer->{$name}(...$args);
|
return self::$sanitizer->{$name}(...$args);
|
||||||
|
} else {
|
||||||
|
throw new \BadMethodCallException("Method Security::{$name} doesn't exist");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user