Hi, I noticed that your code uses ArrayAccess to get and set dependencies from the container. Slim allows for any ContainerInterface and I wanted to use PHP-ID which does not implement ArrayAccess any more. Instead it uses set().
The ContainerInterface only defines get(<id>) and has(<id>) so I changed all occurrences of getting dependencies from the container from $container[<id>] to $container->get(<id>)
For setting phpErrorHandler, errorHandler, whoops I added a check:
If the container implements ArrayAccess it is used to set the dependencies, if not a callback is executed. I figured that
$container->set(<id>,<value>);
should be enough for most of the simple containers out there.
If you need a custom callback you can set it with setContainerSetImplementation(<callback>).
Hi, I noticed that your code uses
ArrayAccess
to get and set dependencies from the container. Slim allows for anyContainerInterface
and I wanted to use PHP-ID which does not implementArrayAccess
any more. Instead it usesset()
.The
ContainerInterface
only definesget(<id>)
andhas(<id>)
so I changed all occurrences of getting dependencies from the container from$container[<id>]
to$container->get(<id>)
For setting
phpErrorHandler
,errorHandler
,whoops
I added a check: If the container implementsArrayAccess
it is used to set the dependencies, if not a callback is executed. I figured thatshould be enough for most of the simple containers out there.
If you need a custom callback you can set it with
setContainerSetImplementation(<callback>)
.