Code Duplication    Length = 5-6 lines in 2 locations

src/Zicht/Tool/Script/Parser/Expression.php 2 locations

@@ 140-144 (lines=5) @@
137
                $ret = new Op\Binary($value, $ret, $this->parse($stream));
138
            } elseif ($stream->match(Token::OPERATOR, '?')) {
139
                $stream->next();
140
                if ($stream->match(Token::OPERATOR, ':')) {
141
                    $then = null;
142
                } else {
143
                    $then = $this->parse($stream);
144
                }
145
146
                if ($stream->valid() && $stream->match(Token::OPERATOR, ':')) {
147
                    $stream->next();
@@ 146-151 (lines=6) @@
143
                    $then = $this->parse($stream);
144
                }
145
146
                if ($stream->valid() && $stream->match(Token::OPERATOR, ':')) {
147
                    $stream->next();
148
                    $else = $this->parse($stream);
149
                } else {
150
                    $else = null;
151
                }
152
                $ret = new Op\Ternary('?', $ret, $then, $else);
153
            }
154
        }