[CORE] Clarify message when calling non existent method in Entity

This commit is contained in:
Hugo Sales 2021-05-06 21:54:10 +00:00
parent 45f54e615c
commit b9fbed2e3d
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 2 additions and 2 deletions

View File

@ -36,11 +36,11 @@ abstract class Entity
if (Formatting::startsWith($name, 'has')) {
$prop = Formatting::camelCaseToSnakeCase(Formatting::removePrefix($name, 'has'));
// https://wiki.php.net/rfc/closure_apply#proposal
$private_property_accessor = function($prop) { return isset($this->{$prop}); };
$private_property_accessor = function ($prop) { return isset($this->{$prop}); };
$private_property_accessor = $private_property_accessor->bindTo($this, get_called_class());
return $private_property_accessor($prop);
}
throw new \Exception("Entity::{$name} called with bogus arguments: " . print_r($arguments, true));
throw new \Exception('Non existent method ' . get_called_class() . "::{$name} called with arguments: " . print_r($arguments, true));
}
/**