File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function getController(Request $request)
78
78
79
79
if (false === strpos ($ controller , ': ' )) {
80
80
if (method_exists ($ controller , '__invoke ' )) {
81
- return new $ controller ( );
81
+ return $ this -> instantiateController ( $ controller );
82
82
} elseif (function_exists ($ controller )) {
83
83
return $ controller ;
84
84
}
@@ -167,6 +167,18 @@ protected function createController($controller)
167
167
throw new \InvalidArgumentException (sprintf ('Class "%s" does not exist. ' , $ class ));
168
168
}
169
169
170
- return array (new $ class (), $ method );
170
+ return array ($ this ->instantiateController ($ class ), $ method );
171
+ }
172
+
173
+ /**
174
+ * Returns an instantiated controller
175
+ *
176
+ * @param string $class A class name
177
+ *
178
+ * @return object
179
+ */
180
+ protected function instantiateController ($ class )
181
+ {
182
+ return new $ class ();
171
183
}
172
184
}
You can’t perform that action at this time.
0 commit comments