Closed
Description
I'm seeing problems trying to get my application up and running again on "naked" HttpKernelAdapter:
PHP Fatal error:
Call to undefined method Volkszaehler\Util\Httpd\ReactInterface::getStaticDirectory() in /home/pi/volkszaehler.org/vendor/php-pm/httpkernel-adapter/Bridges/HttpKernel.php on line 61
This is what it comes down to:
-
BridgeInterface
apparently relies onBootstrapInterface
but doesn't declare this dependency in the constructor https://github.com/php-pm/php-pm/blob/master/Bridges/BridgeInterface.php#L17. This dependency should be explicit? -
HttpKernel->getStaticDirectory
relies onBootstrapInterface->getStaticDirectory
which isn't part of the interface (https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L59). We could either addgetStaticDirectory
to theBootstrapInterface
but it feels kind of redundant and some applications may not need it (they could return empty- I'd prefer this approach). Alternatively add a secondStaticContentInterface
that a bridge can chose to implement or not- sounds a bit overkill? - https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L149 relies on
BootstrapInterface->requestClass()
which isn't part of the interface. An approach might again be forHttpKernel
to use Symfony/HttpFoundation/Request as class unlessBootstrap
implementsRequestClassInterface
which allows to return a more specific class. We could get rid ofAbstractBootstrap
then.
May sound a bit complex but would remove the hard and non-explicit dependencies. I'd be happy to draft a patch if the direction becomes clear/ gets buy-in.