Code Duplication    Length = 17-17 lines in 2 locations

src/SSH/Driver/Sftp.php 1 location

@@ 150-166 (lines=17) @@
147
     * @override
148
     * @inheritDoc
149
     */
150
    public function disconnect()
151
    {
152
        if ($this->resource === null || !is_resource($this->resource))
153
        {
154
            return;
155
        }
156
157
        $this->pause();
158
159
        foreach ($this->resources as $resource)
160
        {
161
            $resource->close();
162
        }
163
164
        $this->handleDisconnect();
165
        $this->emit('disconnect', [ $this ]);
166
    }
167
168
    /**
169
     * @override

src/SSH/Driver/Shell.php 1 location

@@ 147-163 (lines=17) @@
144
     * @override
145
     * @inheritDoc
146
     */
147
    public function disconnect()
148
    {
149
        if ($this->resource === null || !is_resource($this->resource))
150
        {
151
            return;
152
        }
153
154
        $this->pause();
155
156
        foreach ($this->resources as $resource)
157
        {
158
            $resource->close();
159
        }
160
161
        $this->handleDisconnect();
162
        $this->emit('disconnect', [ $this ]);
163
    }
164
165
    /**
166
     * @override