| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function process(Request $request, Handler $handler) : Response |
||
| 37 | { |
||
| 38 | $greeting = $handler->getConnection()->open(); |
||
| 39 | |||
| 40 | if ($greeting->equals($this->greeting)) { |
||
| 41 | return $handler->handle($request); |
||
| 42 | } |
||
| 43 | |||
| 44 | $handler->handle(new AuthenticateRequest( |
||
| 45 | $greeting->getSalt(), |
||
| 46 | $this->username, |
||
| 47 | $this->password |
||
| 48 | )); |
||
| 49 | |||
| 50 | $this->greeting = $greeting; |
||
| 51 | |||
| 52 | return $handler->handle($request); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |