Code Duplication    Length = 9-10 lines in 4 locations

PHPDaemon/Clients/IRC/Connection.php 2 locations

@@ 111-120 (lines=10) @@
108
            $cmd = IRC::getCommandByCode((int)$cmd);
109
        }
110
        $line = $cmd;
111
        for ($i = 1, $s = func_num_args(); $i < $s; ++$i) {
112
            $arg = func_get_arg($i);
113
            if (($i + 1 === $s) && (mb_orig_strpos($arg, "\x20") !== false)) {
114
                $line .= ' :';
115
            } else {
116
                $line .= ' ';
117
            }
118
            $line .= $arg;
119
        }
120
        $this->writeln($line);
121
        if ($this->pool->protologging) {
122
            Daemon::log('->->->-> ' . $line);
123
        }
@@ 141-149 (lines=9) @@
138
            $cmd = IRC::getCommandByCode((int)$cmd);
139
        }
140
        $line = $cmd;
141
        for ($i = 0, $s = sizeof($args); $i < $s; ++$i) {
142
            if (($i + 1 === $s) && (mb_orig_strpos($args[$i], "\x20") !== false)) {
143
                $line .= ' :';
144
            } else {
145
                $line .= ' ';
146
            }
147
            $line .= $args[$i];
148
        }
149
        $this->writeln($line);
150
        if ($this->pool->protologging && $cmd !== 'PONG') {
151
            Daemon::log('->->->-> ' . $line);
152
        }

PHPDaemon/Servers/IRCBouncer/Connection.php 2 locations

@@ 98-107 (lines=10) @@
95
        }
96
        $cmd = IRC::getCodeByCommand($cmd);
97
        $line = ':' . $from . ' ' . $cmd;
98
        for ($i = 2, $s = func_num_args(); $i < $s; ++$i) {
99
            $arg = func_get_arg($i);
100
            if (($i + 1 === $s) && (mb_orig_strpos($arg, "\x20") !== false)) {
101
                $line .= ' :';
102
            } else {
103
                $line .= ' ';
104
            }
105
            $line .= $arg;
106
        }
107
        $this->writeln($line);
108
        if ($this->pool->protologging && $cmd !== 'PONG') {
109
            Daemon::log('=>=>=>=> ' . json_encode($line));
110
        }
@@ 130-138 (lines=9) @@
127
        }
128
        $cmd = IRC::getCodeByCommand($cmd);
129
        $line = ':' . $from . ' ' . $cmd;
130
        for ($i = 0, $s = sizeof($args); $i < $s; ++$i) {
131
            if (($i + 1 === $s) && (mb_orig_strpos($args[$i], "\x20") !== false)) {
132
                $line .= ' :';
133
            } else {
134
                $line .= ' ';
135
            }
136
            $line .= $args[$i];
137
        }
138
        $this->writeln($line);
139
        if ($this->pool->protologging && $cmd !== 'PONG') {
140
            Daemon::log('=>=>=>=> ' . json_encode($line));
141
        }