| Conditions | 3 |
| Paths | 1 |
| Total Lines | 40 |
| Code Lines | 26 |
| Lines | 30 |
| Ratio | 75 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function boot() |
||
| 12 | { |
||
| 13 | $credentials = $this->app->make(ApnCredentials::class); |
||
| 14 | |||
| 15 | $this->app->when(ApnChannel::class) |
||
| 16 | ->needs(Message::class) |
||
| 17 | View Code Duplication | ->give(function ($app) use ($credentials) { |
|
| 18 | $client = new Message; |
||
| 19 | |||
| 20 | try { |
||
| 21 | $client->open( |
||
| 22 | $credentials->environment(), |
||
| 23 | $credentials->certificate(), |
||
| 24 | $credentials->passPhrase() |
||
| 25 | ); |
||
| 26 | } catch (Exception $exception) { |
||
| 27 | throw ConnectionFailed::create($exception); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $client; |
||
| 31 | }); |
||
| 32 | |||
| 33 | $this->app->when(FeedbackService::class) |
||
| 34 | ->needs(Feedback::class) |
||
| 35 | View Code Duplication | ->give(function ($app) use ($credentials) { |
|
| 36 | $client = new Feedback; |
||
| 37 | |||
| 38 | try { |
||
| 39 | $client->open( |
||
| 40 | $credentials->environment(), |
||
| 41 | $credentials->certificate(), |
||
| 42 | $credentials->passPhrase() |
||
| 43 | ); |
||
| 44 | } catch (Exception $exception) { |
||
| 45 | throw ConnectionFailed::create($exception); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $client; |
||
| 49 | }); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.