| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3.4977 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 1 | public function initScanner() { |
|
| 53 | 1 | parent::initScanner(); |
|
| 54 | 1 | $this->writeHandle = @\stream_socket_client( |
|
| 55 | 1 | 'unix://' . $this->socket, $errorCode, $errorMessage, 5 |
|
| 56 | 1 | ); |
|
| 57 | 1 | if (!$this->getWriteHandle()) { |
|
| 58 | 1 | throw new InitException( |
|
| 59 | 1 | \sprintf( |
|
| 60 | 1 | 'Could not connect to socket "%s": %s (code %d)', |
|
| 61 | 1 | $this->socket, |
|
| 62 | 1 | $errorMessage, |
|
| 63 | $errorCode |
||
| 64 | 1 | ) |
|
| 65 | 1 | ); |
|
| 66 | } |
||
| 67 | |||
| 68 | if (@\fwrite($this->getWriteHandle(), "nINSTREAM\n") === false) { |
||
| 69 | throw new InitException( |
||
| 70 | \sprintf( |
||
| 71 | 'Writing to socket "%s" failed', |
||
| 72 | $this->socket |
||
| 73 | ) |
||
| 74 | ); |
||
| 75 | } |
||
| 76 | } |
||
| 77 | } |
||
| 78 |