Code Duplication    Length = 10-12 lines in 6 locations

src/SyntaxHighlightPrinter.php 6 locations

@@ 179-189 (lines=11) @@
176
     *
177
     * @return string
178
     */
179
    public function pStmt_ElseIf(Stmt\ElseIf_ $node)
180
    {
181
        return sprintf(
182
            " %s (%s) %s%s\n%s",
183
            $this->color('elseif', SyntaxHighlighterConfig::TYPE_KEYWORD),
184
            $this->p($node->cond),
185
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
186
            $this->pStmts($node->stmts),
187
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
188
        );
189
    }
190
191
    /**
192
     * @param Stmt\For_ $node
@@ 237-247 (lines=11) @@
234
     *
235
     * @return string
236
     */
237
    public function pStmt_While(Stmt\While_ $node)
238
    {
239
        return sprintf(
240
            "%s (%s) %s%s\n%s",
241
            $this->color('while', SyntaxHighlighterConfig::TYPE_KEYWORD),
242
            $this->p($node->cond),
243
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
244
            $this->pStmts($node->stmts),
245
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
246
        );
247
    }
248
249
    /**
250
     * @param Stmt\Do_ $node
@@ 254-265 (lines=12) @@
251
     *
252
     * @return string
253
     */
254
    public function pStmt_Do(Stmt\Do_ $node)
255
    {
256
        return sprintf(
257
            "%s %s%s \n%s %s (%s);",
258
            $this->color('do', SyntaxHighlighterConfig::TYPE_KEYWORD),
259
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
260
            $this->pStmts($node->stmts),
261
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE),
262
            $this->color('while', SyntaxHighlighterConfig::TYPE_KEYWORD),
263
            $this->p($node->cond)
264
        );
265
    }
266
267
    /**
268
     * @param Stmt\Switch_ $node
@@ 272-282 (lines=11) @@
269
     *
270
     * @return string
271
     */
272
    public function pStmt_Switch(Stmt\Switch_ $node)
273
    {
274
        return sprintf(
275
            "%s (%s) %s%s\n%s",
276
            $this->color('switch', SyntaxHighlighterConfig::TYPE_KEYWORD),
277
            $this->p($node->cond),
278
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
279
            $this->pStmts($node->cases),
280
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
281
        );
282
    }
283
284
    /**
285
     * @param Stmt\Case_ $node
@@ 333-344 (lines=12) @@
330
     *
331
     * @return string
332
     */
333
    public function pStmt_Catch(Stmt\Catch_ $node)
334
    {
335
        return sprintf(
336
            " %s (%s $%s) %s%s\n%s",
337
            $this->color('catch', SyntaxHighlighterConfig::TYPE_KEYWORD),
338
            $this->p($node->type),
339
            $node->var,
340
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
341
            $this->pStmts($node->stmts),
342
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
343
        );
344
    }
345
346
    /**
347
     * @param Stmt\Break_ $node
@@ 430-439 (lines=10) @@
427
     *
428
     * @return string
429
     */
430
    public function pStmt_Else(Stmt\Else_ $node)
431
    {
432
        return sprintf(
433
            " %s %s%s\n%s",
434
            $this->color('else', SyntaxHighlighterConfig::TYPE_KEYWORD),
435
            $this->color('{', SyntaxHighlighterConfig::TYPE_BRACE),
436
            $this->pStmts($node->stmts),
437
            $this->color('}', SyntaxHighlighterConfig::TYPE_BRACE)
438
        );
439
    }
440
441
    /**
442
     * @param Expr\FuncCall $node