Merge pull request #7225 from silverstripe/pulls/4.0/injector-extension-setters

Use ClassInfo::hasMethod instead of method_exists()
This commit is contained in:
Damian Mooyman 2017-07-31 10:23:10 +12:00 committed by GitHub
commit 9392380dd1

View File

@ -761,7 +761,7 @@ class Injector implements ContainerInterface
*/
protected function setObjectProperty($object, $name, $value)
{
if (method_exists($object, 'set'.$name)) {
if (ClassInfo::hasMethod($object, 'set'.$name)) {
$object->{'set'.$name}($value);
} else {
$object->$name = $value;