Code Duplication    Length = 14-14 lines in 2 locations

src/Client/ZeroMqClient.php 1 location

@@ 60-73 (lines=14) @@
57
    /**
58
     * @return ZMQSocket
59
     */
60
    private function getSocket()
61
    {
62
        if ($this->socket === null) {
63
            $context = new ZMQContext();
64
65
            $host = $this->location->getHost();
66
            $port = $this->location->getPort();
67
68
            $this->socket = new ZMQSocket($context, ZMQ::SOCKET_PUSH, spl_object_hash($this));
69
            $this->socket->connect("tcp://{$host}:$port");
70
        }
71
72
        return $this->socket;
73
    }
74
75
    /**
76
     * @inheritdoc

src/Server/ZeroMqServer.php 1 location

@@ 96-109 (lines=14) @@
93
    /**
94
     * @return ZMQSocket
95
     */
96
    private function getSocket()
97
    {
98
        if ($this->socket === null) {
99
            $context = new ZMQContext();
100
101
            $host = $this->location->getHost();
102
            $port = $this->location->getPort();
103
104
            $this->socket = new ZMQSocket($context, ZMQ::SOCKET_PULL, spl_object_hash($this));
105
            $this->socket->bind("tcp://{$host}:$port");
106
        }
107
108
        return $this->socket;
109
    }
110
111
    /**
112
     * @param Event $event