Code Duplication    Length = 16-16 lines in 2 locations

PHPDaemon/Core/ShellCommand.php 1 location

@@ 476-491 (lines=16) @@
473
     * @param  string Data to send
474
     * @return boolean Success
475
     */
476
    public function writeln($data)
477
    {
478
        if (!$this->alive) {
479
            Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
480
            return false;
481
        }
482
        if (!isset($this->bevWrite)) {
483
            return false;
484
        }
485
        if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) {
486
            return true;
487
        }
488
        $this->writing = true;
489
        $this->bevWrite->write($data);
490
        $this->bevWrite->write($this->EOL);
491
        return true;
492
    }
493
494
    /**

PHPDaemon/Network/IOStream.php 1 location

@@ 668-683 (lines=16) @@
665
     * @param  string  $data Data to send
666
     * @return boolean       Success
667
     */
668
    public function writeln($data)
669
    {
670
        if (!$this->alive) {
671
            Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
672
            return false;
673
        }
674
        if (!isset($this->bev)) {
675
            return false;
676
        }
677
        if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) {
678
            return true;
679
        }
680
        $this->writing = true;
681
        $this->bev->write($data);
682
        $this->bev->write($this->EOL);
683
        return true;
684
    }
685
686
    /**