We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 912806b commit 91a3d63Copy full SHA for 91a3d63
src/MiladRahimi/PHPRouter/Router.php
@@ -218,7 +218,9 @@ public function dispatch() {
218
if (method_exists($list[0], $list[1])) {
219
$mid_args = $arguments;
220
$mid_args = $this->arrangeMethodArgs($list[0], $list[1], $mid_args);
221
- $this->publish(call_user_func_array($list[0]->$list[1], $mid_args));
+
222
+ $mid_instance = new $list[0];
223
+ $this->publish(call_user_func_array(array($mid_instance, $list[1]), $mid_args));
224
} else {
225
throw new BadMiddleware('Cannot detect the middleware method');
226
}
0 commit comments