| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function encrypt(int $type = STREAM_CRYPTO_METHOD_ANY_CLIENT) : bool |
||
| 25 | { |
||
| 26 | if ($this->_secured) { |
||
| 27 | return true; |
||
| 28 | } |
||
| 29 | |||
| 30 | $result = true; |
||
| 31 | $result &= stream_set_blocking($this->stream, 1); |
||
| 32 | $result &= stream_socket_enable_crypto($this->stream, true, $type); |
||
| 33 | $result &= stream_set_blocking($this->stream, 0); |
||
| 34 | |||
| 35 | return $this->_secured = $result; |
||
| 36 | } |
||
| 37 | |||
| 52 |