It seems like $tenantManager of type App\Services\TenantManager is incompatible with the declared type App\Resolvers\App\Services\TenantManager of property $tenantManager.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
Loading history...
20
}
21
22
/**
23
* Resolve user by provider credentials.
24
*
25
* @param string $provider
26
* @param string $accessToken
27
*
28
* @return Authenticatable|null
29
*/
30
public function resolveUserByProviderCredentials(string $provider, string $accessToken): ?Authenticatable
31
{
32
// Return the user that corresponds to provided credentials.
33
// If the credentials are invalid, then return NULL.
34
switch ($provider) {
35
case 'google':
36
return $this->googleAuth($accessToken);
37
}
38
39
return null;
40
}
41
42
protected function googleAuth(string $accessToken): ?Authenticatable
43
{
44
$client = new \Google_Client(['client_id' => config('auth.google_oauth_client_id')]);
The expression $payload of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
Loading history...
47
$userName = $payload['email'];
48
if ($this->tenantManager->loadTenantByUsername($userName)) {