Code Duplication    Length = 19-19 lines in 2 locations

PHPDaemon/Network/IOStream.php 1 location

@@ 658-676 (lines=19) @@
655
     * @param  string $data Data to send
656
     * @return boolean       Success
657
     */
658
    public function write($data)
659
    {
660
        if (!$this->alive) {
661
            Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
662
            return false;
663
        }
664
        if (!isset($this->bev)) {
665
            return false;
666
        }
667
        if (!mb_orig_strlen($data)) {
668
            return true;
669
        }
670
        $this->writing = true;
671
        Daemon::$noError = true;
672
        if (!$this->bev->write($data) || !Daemon::$noError) {
673
            $this->close();
674
            return false;
675
        }
676
        return true;
677
    }
678
679
    /**

PHPDaemon/Core/ShellCommand.php 1 location

@@ 411-429 (lines=19) @@
408
     * @param  string $data Data to send
409
     * @return boolean Success
410
     */
411
    public function write($data)
412
    {
413
        if (!$this->alive) {
414
            Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
415
            return false;
416
        }
417
        if (!isset($this->bevWrite)) {
418
            return false;
419
        }
420
        if (!mb_orig_strlen($data)) {
421
            return true;
422
        }
423
        $this->writing = true;
424
        Daemon::$noError = true;
425
        if (!$this->bevWrite->write($data) || !Daemon::$noError) {
426
            $this->close();
427
            return false;
428
        }
429
        return true;
430
    }
431
432
    /**