So, methods such as prependMiddleware and pushMiddleware only exist on concrete implementation Illuminate\Foundation\Http\Kernel, and not on interface Illuminate\Contracts\Http\Kernel. This was flagged up by static analysis, so I'd flipped the boot to require the concrete rather than abstract. However, by doing so, Laravel instead magically instantiates a new, entirely separate Kernel implementation, rather than using the one already in the DI container. I've flipped back to depending on the interface (yay) and suppressed static analysis to tell it with @param that the concrete implementation is what gets passed. Just like the issue fixed in #9, (see https://github.com/scoutapp/scout-apm-laravel/blob/b1eb5219ef02d2c68d1dc94ce2d9062e2acf83e9/src/View/Engine/ScoutViewEngineDecorator.php#L48-L49)
So, methods such as
prependMiddleware
andpushMiddleware
only exist on concrete implementationIlluminate\Foundation\Http\Kernel
, and not on interfaceIlluminate\Contracts\Http\Kernel
. This was flagged up by static analysis, so I'd flipped theboot
to require the concrete rather than abstract. However, by doing so, Laravel instead magically instantiates a new, entirely separateKernel
implementation, rather than using the one already in the DI container. I've flipped back to depending on the interface (yay) and suppressed static analysis to tell it with@param
that the concrete implementation is what gets passed. Just like the issue fixed in #9, (see https://github.com/scoutapp/scout-apm-laravel/blob/b1eb5219ef02d2c68d1dc94ce2d9062e2acf83e9/src/View/Engine/ScoutViewEngineDecorator.php#L48-L49)