I am trying to use the Type Hinting function in my application, but something is not working correctly. I tried the following
define('PULSE_START', microtime(true)); require('../Pulse/Bootstrap/Bootstrap.php'); $app = new Application(); $app->run(); $app->get('/404', function(Application $app) { $app->error(404); });
And instead of 404 output, I got this
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of Pulse\Core\Application, none given in E:\Server\xampp\htdocs\web\pulse\WWW\Index.php on line 23
I don’t understand, the Application class is a class with names (Pulse \ Core \ Application), but I created an alias, so I don’t think the problem is.
source share