Code Duplication    Length = 11-11 lines in 2 locations

src/Comodojo/Extender/Components/Ipc.php 2 locations

@@ 63-73 (lines=11) @@
60
61
    }
62
63
    public function read($uid) {
64
65
        $reader = $this->ipc[$uid][self::READER];
66
67
        $result = socket_read($reader, $this->bytes, PHP_BINARY_READ);
68
69
        if ( $result === false ) throw new Exception("Socket error: ".socket_strerror(socket_last_error($reader)));
70
71
        return $result;
72
73
    }
74
75
    public function write($uid, $data) {
76
@@ 75-85 (lines=11) @@
72
73
    }
74
75
    public function write($uid, $data) {
76
77
        $writer = $this->ipc[$uid][self::WRITER];
78
79
        $result = socket_write($writer, $data, strlen($data));
80
81
        if ( $result === false ) throw new Exception("Socket error: ".socket_strerror(socket_last_error($writer)));
82
83
        return $result;
84
85
    }
86
87
    public function close($uid, $handler) {
88