Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function createAuthenticatedGoogleClient(array $config): Google_Client |
||
21 | { |
||
22 | $client = new Google_Client(); |
||
23 | |||
24 | $credentials = $client->loadServiceAccountJson( |
||
25 | $config['service_account_credentials_json'], |
||
26 | 'https://www.googleapis.com/auth/analytics.readonly' |
||
|
|||
27 | ); |
||
28 | |||
29 | $client->setAssertionCredentials($credentials); |
||
30 | |||
31 | return $client; |
||
32 | } |
||
33 | |||
43 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: