2 namespace TYPO3\CMS\Core\Http;
41 return call_user_func_array($target, array($request, $response));
54 if (is_array($target)) {
58 if (is_object($target) && $target instanceof \Closure) {
63 if (is_string($target) && strpos($target,
':') ===
false) {
65 if (!method_exists($targetObject,
'__invoke')) {
66 throw new \InvalidArgumentException(
'Object "' . $target .
'" doesn\'t implement an __invoke() method and cannot be used as target.', 1442431631);
72 if (is_string($target) && strpos($target,
'::') !==
false) {
73 list($className, $methodName) = explode(
'::', $target, 2);
75 return [$targetObject, $methodName];
79 if (is_callable($target)) {
83 throw new \InvalidArgumentException(
'Invalid target for "' . $target .
'", as it is not callable.', 1425381442);