simplify object creation without container

dispatcher-rework
fadrian06 3 days ago
parent 9e08573896
commit 6afe25ddb5

@ -324,12 +324,11 @@ class Dispatcher
$this->verifyValidClassCallable($class, $method, $object); $this->verifyValidClassCallable($class, $method, $object);
// Class is a string, and method exists, create the object by hand and inject only the Engine
if (is_string($class)) { if (is_string($class)) {
$class = new $class($this->engine); $class = new $class($this->engine);
} }
return call_user_func_array([$class, $method], $params); return $class->$method(...$params);
} }
/** /**

Loading…
Cancel
Save