PrettyPrinter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 12
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A pExpr_Array() 0 10 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\UniLex\Console;
6
7
use PhpParser\Node\Expr;
8
use PhpParser\PrettyPrinter\Standard;
9
10
final class PrettyPrinter extends Standard
11
{
12
    protected function pExpr_Array(Expr\Array_ $node)
13
    {
14
        $syntax = $node->getAttribute(
15
            'kind',
16
            $this->options['shortArraySyntax'] ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG
17
        );
18
        if ($syntax === Expr\Array_::KIND_SHORT) {
19
            return '[' . $this->pCommaSeparatedMultiline($node->items, true) . $this->nl . ']';
20
        } else {
21
            return 'array(' . $this->pCommaSeparatedMultiline($node->items, true) . $this->nl . ')';
22
        }
23
    }
24
}
25