From the fact that none
is being given as the passed in type value I'm thinking get isn't passing a parameter when using the closure. To get $app into the closure you can use
the application instead.
$app->get('/404', function() use ($app)
{
$app->error(404);
});
And verify that your get
method is passing $this
as the first argument of the anonymous function.