Code Duplication    Length = 4-4 lines in 3 locations

src/Comodojo/Daemon/Socket/Server.php 2 locations

@@ 129-132 (lines=4) @@
126
            $this->socket_port
127
        );
128
129
        if ( $bind === false ) {
130
            $error = self::getSocketError($this->socket);
131
            throw new SocketException("Cannot bind socket: $error");
132
        }
133
134
        socket_set_nonblock($this->socket);
135
@@ 154-157 (lines=4) @@
151
152
        $listen = socket_listen($this->socket);
153
154
        if ( $listen === false ) {
155
            $error = self::getSocketError($this->socket);
156
            throw new SocketException("Cannot put socket in listening mode: $error");
157
        }
158
159
        $this->logger->debug("Socket listening on ".$this->handler);
160

src/Comodojo/Daemon/Socket/SocketTransport.php 1 location

@@ 92-95 (lines=4) @@
89
            $this->socket_port
90
        );
91
92
        if ( $connect === false ) {
93
            $error = self::getSocketError($this->socket);
94
            throw new SocketException("Cannot connect to socket: $error");
95
        }
96
97
        $greeter = $this->readGreeter();
98