--level used: 5After bumping my composer dependencies, phpstan analyse will throw errors with regards to app/Providers/TelescopeServiceProvider.php lines 24 and 42.
------ -------------------------------------------------------------------------------------
Line app/Providers/TelescopeServiceProvider.php
------ -------------------------------------------------------------------------------------
24 Call to an undefined method Illuminate\Contracts\Foundation\Application::isLocal().
42 Call to an undefined method Illuminate\Contracts\Foundation\Application::isLocal().
------ -------------------------------------------------------------------------------------
// inside TelescopeServiceProvider::register()
Telescope::filter(function (IncomingEntry $entry) {
if ($this->app->isLocal()) {
return true;
}
// ...
Line 48 is a same call to $this->app->isLocal().
Clicking through on isLocal() in PhpStorm finds the appropriate method, so I am not sure what is going on and why phpstan/larastan is complaining?
I've pinpointed it to version 0.5.6 introducing the above false positive.
Before bumping the deps, I was on 0.5.5 which did not present the issue.
isLocal() is defined in https://github.com/laravel/framework/blob/c931bfa2ca0be245c2bcda5d6c1aae2196045157/src/Illuminate/Foundation/Application.php#L537
but we've got another type in
https://github.com/illuminate/support/blob/master/ServiceProvider.php#L18
The bug introduced in this commit https://github.com/nunomaduro/larastan/commit/38058ec4722ee435242ad1be8d5f215cda6fe711
Arguments passed to Str::startsWith are in the wrong order :smile: I'll accept a PR where the order of the arguments is changed in all occurrences of Str::startsWith :+1:
All???
I think @canvural means all occurrences in https://github.com/nunomaduro/larastan/commit/38058ec4722ee435242ad1be8d5f215cda6fe711
There are 3 places where the order of the arguments is incorrect in that commit.