Accessing locale on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
If you access a property on an interface, you most likely code against a
concrete implementation of the interface.
The method put() does not seem to exist on object<Symfony\Component...ssion\SessionInterface>.
This check looks for calls to methods that do not seem to exist on a given type.
It looks for the method on the type itself as well as in inherited classes or
implemented interfaces.
This is most likely a typographical error or the method has been renamed.
Loading history...
31
}
32
}
33
34
/**
35
* Set locale and return home url.
36
*
37
* @param string $locale
38
* @param \Illuminate\Http\Request $request
39
**/
40
public function setHome($locale, Request $request)
It seems like url('/') targeting url() can also be of type object<Illuminate\Contracts\Routing\UrlGenerator>; however, redirect() does only seem to accept string|null, maybe add an additional type check?
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: