scoutapp / scout-apm-laravel

ScoutAPM PHP Agent for the Laravel Framework
MIT License
22 stars 12 forks source link

Service provider fixes #16

Closed asgrim closed 5 years ago

asgrim commented 5 years ago

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)