forked from GNUsocial/gnu-social
[CORE] Throw more meaningfull error when method doesn't exist in Security and Entity
This commit is contained in:
parent
f8107c86c5
commit
9b862d6a26
@ -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 {
|
||||||
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user