| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 2 | public function negotiate(Client $client): void |
|
| 52 | { |
||
| 53 | 2 | if (empty($this->connection->getMetaData(['crypto']))) { |
|
| 54 | 2 | $reply = $client->request(new EhloCommand($this->ehlo)); |
|
| 55 | 2 | $reply->assertCompleted(); |
|
| 56 | |||
| 57 | 2 | $ehloResponse = new EhloResponse($reply); |
|
| 58 | |||
| 59 | 2 | if ($ehloResponse->isAdvertising('STARTTLS')) { |
|
| 60 | $client |
||
| 61 | 1 | ->request(new StartTlsCommand()) |
|
| 62 | 1 | ->assertCompleted(); |
|
| 63 | |||
| 64 | 1 | $this->connection->upgrade($this->crypto); |
|
| 65 | } |
||
| 66 | } |
||
| 67 | } |
||
| 68 | } |