mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7225 from silverstripe/pulls/4.0/injector-extension-setters
Use ClassInfo::hasMethod instead of method_exists()
This commit is contained in:
commit
9392380dd1
@ -761,7 +761,7 @@ class Injector implements ContainerInterface
|
|||||||
*/
|
*/
|
||||||
protected function setObjectProperty($object, $name, $value)
|
protected function setObjectProperty($object, $name, $value)
|
||||||
{
|
{
|
||||||
if (method_exists($object, 'set'.$name)) {
|
if (ClassInfo::hasMethod($object, 'set'.$name)) {
|
||||||
$object->{'set'.$name}($value);
|
$object->{'set'.$name}($value);
|
||||||
} else {
|
} else {
|
||||||
$object->$name = $value;
|
$object->$name = $value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user