Code Duplication    Length = 9-10 lines in 2 locations

src/SSH/Driver/Sftp/SftpResource.php 1 location

@@ 278-287 (lines=10) @@
275
                return;
276
            }
277
278
            if ($ret !== '')
279
            {
280
                $this->emit('data', [ $this, $ret ]);
281
282
                if (strlen($ret) < $length)
283
                {
284
                    $this->reading = false;
285
                    $this->emit('end', [ $this ]);
286
                }
287
            }
288
        }
289
        catch (Error $ex)
290
        {

src/SSH/Driver/Shell/ShellResource.php 1 location

@@ 335-343 (lines=9) @@
332
                new ReadException('Cannot read stream.')
333
            );
334
        }
335
        else if ($ret !== '')
336
        {
337
            $this->emit('data', [ $this, $ret ]);
338
339
            if (strlen($ret) < $length)
340
            {
341
                $this->emit('end', [ $this ]);
342
            }
343
        }
344
345
        return $ret;
346
    }