1 | <?php |
||
11 | trait MultiauthActions |
||
12 | { |
||
13 | use MakesHttpRequests, InteractsWithConsole; |
||
14 | |||
15 | /** |
||
16 | * The route to generate the access token. The default value is the standard |
||
17 | * route from Laravel\Passport. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $oauthTokenRoute = 'oauth/token'; |
||
22 | |||
23 | /** |
||
24 | * @codeCoverageIgnore |
||
25 | */ |
||
26 | public function setUp() |
||
32 | |||
33 | /** |
||
34 | * Set the the Authorization header with an access token created using |
||
35 | * Laravel Passport. |
||
36 | * |
||
37 | * @todo Change way to issue token from $this->json() to creating accessing |
||
38 | * AccessTokenController@issueToken directly. |
||
39 | * @todo Pass this method to PassportMultiauth::actingAs(). |
||
40 | * |
||
41 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
||
42 | * @param string $scope |
||
43 | * @return $this |
||
44 | */ |
||
45 | 9 | public function multiauthActingAs(Authenticatable $user, $scope = '') |
|
80 | |||
81 | /** |
||
82 | * Get the user provider on configs. |
||
83 | * |
||
84 | * @todo Move to class specialized in check auth configs. |
||
85 | * @param \Illuminate\Contracts\Auth\Authenticatable $user |
||
86 | * @return string |
||
87 | */ |
||
88 | 8 | protected function getUserProvider(Authenticatable $user) |
|
99 | |||
100 | /** |
||
101 | * Check if provider is the default provider used by Laravel\Passport. |
||
102 | * |
||
103 | * @todo Move to class specialized in check auth configs. |
||
104 | * @param string $provider |
||
105 | * @return boolean |
||
106 | */ |
||
107 | 8 | protected function isDefaultProvider(string $provider) |
|
111 | } |
||
112 |
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: