You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($this->container->has($controller) && method_exists($service = $this->container->get($controller), '__invoke')) {
74
-
// invokable controller in the "service" notation
75
-
return$service;
83
+
if (!method_exists($service, '__invoke')) {
84
+
thrownew \LogicException(sprintf('The controller "%s" cannot be called without a method name. Did you forget an "__invoke" method?', $controller));
76
85
}
77
86
78
-
thrownew \LogicException(sprintf('Unable to parse the controller name "%s".', $controller));
87
+
return$service;
79
88
}
80
89
81
90
/**
@@ -94,10 +103,19 @@ protected function instantiateController($class)
94
103
} catch (\TypeError$e) {
95
104
}
96
105
97
-
if ($this->containerinstanceof Container && isset($this->container->getRemovedIds()[$class])) {
98
-
thrownew \LogicException(sprintf('Controller "%s" cannot be fetched from the container because it is private. Did you forget to tag the service with "controller.service_arguments"?', $class), 0, $e);
if ($this->containerinstanceof Container && isset($this->container->getRemovedIds()[$controller])) {
118
+
thrownew \LogicException(sprintf('Controller "%s" cannot be fetched from the container because it is private. Did you forget to tag the service with "controller.service_arguments"?', $controller), 0, $previous);
* @expectedExceptionMessage Controller "app.my_controller" cannot be fetched from the container because it is private. Did you forget to tag the service with "controller.service_arguments"?
0 commit comments