I am probably going to feel dumb when someone comments on this but here goes:
I just started experimenting with slim for an upcoming project and wanted to get some good error output - like stack traces while I make newbee mistakes. So from the online docs I tried
$configuration = [
‘settings’ => [
‘displayErrorDetails’ => true,
],
];
$c = new \Slim\Container($configuration);
$app = new \Slim\App($c);
But this throws an error since the Slim\App class constructor requires an array not a Slim\Container as its single argument.
So whats going - am I reading the wrong docs ?
So I tried passing the array $configuration to the Slim\App constructor, no joy still cryptic error messages.
If I hack the two error handlers to make the test
if ($this->displayErrorDetails || true)
I get useful error output. So I am on the right track with trying to configure the error handlers - but without more digging through the Slim dont know where in the config process I should change the displayErrorDetails flag.
this is the config code that actually succeeds in turning on error details.
The other interesting thing I found by following the code through is that although ErrorHandle and phpErrorHandler are registered with the container they are never used from the container.
Slim\App creates instances of these two error handlers by itself and references the class name directly in doing so.
My guess is that the code is partway through a conversion to using the Container more widely and the active code for creating error handlers is still the “old stuff”.