Use ClassInfo::hasMethod instead of method_exists()

This allows for setters to exist in extension instances.
This commit is contained in:
Aaron Carlino 2017-07-30 22:43:28 +12:00 committed by GitHub
parent 1a4211f089
commit c9cf7b1d75

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;