Closed rbairwell closed 8 years ago
map()
takes a string too…
$app->get('/', 'Application/HomeAction');
Yep, but string typehint is only PHP 7+ . map takes array, string, callable.
map
takes array, string, callable|string
Ah, sorry, so it does. My mistake. I'll see if I can do a PR to make it clearer (document it as callable|string or keep it as "mixed" and add comment that can be string or callable?)
Slim3 appears (according to the composer.json) to only support PHP 5.5 upwards - which means the "callable" type hint/declaration ( http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration ) is valid as it was introduced in 5.4.
Would it, therefore, be possible to have all callables (such as Slim\App::map ) typehinted as such? I can try and do this myself and make a PR, but I'd like to check first that it was just something that was missed rather than an actual decision not to typehint callables.