| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4.0119 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 7 | public function process(Request $request, Handler $handler) : Response |
|
| 34 | { |
||
| 35 | 7 | $connection = $handler->getConnection(); |
|
| 36 | |||
| 37 | 7 | if ($this->isSucceeded && $connection->isClosed()) { |
|
| 38 | $this->isSucceeded = false; |
||
| 39 | } |
||
| 40 | |||
| 41 | 7 | if (!$this->isSucceeded) { |
|
| 42 | 7 | $handler->handle(new AuthenticateRequest( |
|
| 43 | 7 | $connection->open(), |
|
| 44 | 7 | $this->username, |
|
| 45 | 7 | $this->password |
|
| 46 | )); |
||
| 47 | 2 | $this->isSucceeded = true; |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | return $handler->handle($request); |
|
| 51 | } |
||
| 53 |