| Conditions | 2 |
| Paths | 1 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function boot() |
||
| 14 | { |
||
| 15 | $this->app->when(AwsPinpointChannel::class) |
||
| 16 | ->needs(AwsPinpointClient::class) |
||
| 17 | ->give(function () { |
||
| 18 | $config = config('aws.Pinpoint'); |
||
| 19 | |||
| 20 | if (is_null($config)) { |
||
| 21 | throw InvalidConfiguration::configurationNotSet(); |
||
| 22 | } |
||
| 23 | |||
| 24 | $client = AwsFacade::createClient( |
||
| 25 | 'pinpoint', |
||
| 26 | [ |
||
| 27 | 'credentials' => [ |
||
| 28 | 'key' => $config['key'], |
||
| 29 | 'secret' => $config['secret'], |
||
| 30 | ], |
||
| 31 | ] |
||
| 32 | ); |
||
| 33 | |||
| 34 | return new AwsPinpointClient($client); |
||
|
|
|||
| 35 | }); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
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: