roadrunner-bundle icon indicating copy to clipboard operation
roadrunner-bundle copied to clipboard

Throw exception when the Kernel does not implement KernelInterface

Open shyim opened this issue 1 year ago • 3 comments

It took me some time to understand that your Kernel needs to implement KernelInterface. It would be much easier when you would throw just an exception when the requirements are not met.

Is there some reason why it currently has an fallback?

https://github.com/Baldinof/roadrunner-bundle/blob/2.x/src/Runtime/Runtime.php#L19

shyim avatar Apr 22 '23 12:04 shyim

Hello,

I would accept a PR to throw when RR_MODE is set but the kernel is not app is not a KernelInterface.

How did you land in that case?

Baldinof avatar May 05 '23 08:05 Baldinof

We do crazy stuff with Symfony Kernels also wrapping them up 😅 https://github.com/shopware/recipes/blob/main/shopware/core/6.4/public/index.php#L53

I will make later a PR :)

shyim avatar May 05 '23 08:05 shyim

Ahah alright, the kernel is only required to retrieve the WorkerRegistryInterface in the runner.

I would also accept something that decouple the runner from the KernelInterface if it can helps.

Baldinof avatar May 05 '23 09:05 Baldinof