Completed
Pull Request — master (#35)
by Saif Eddin
02:55 queued 38s
created

StaticCallPrinter::convert()   B

Complexity

Conditions 5
Paths 16

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 5.9256

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 9
cp 0.6667
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 9
nc 16
nop 1
crap 5.9256
1
<?php
2
3
namespace PhpToZephir\Converter\Printer\Expr;
4
5
use PhpParser\Node\Expr;
6
use PhpToZephir\Converter\SimplePrinter;
7
8
class StaticCallPrinter extends SimplePrinter
9
{
10
    /**
11
     * @return string
12
     */
13 1
    public static function getType()
14
    {
15 1
        return 'pExpr_StaticCall';
16
    }
17
18
    /**
19
     * @param Expr\StaticCall $node
20
     *
21
     * @return string
22
     */
23 1
    public function convert(Expr\StaticCall $node)
24
    {
25 1
        return (($node->class instanceof Expr\Variable) ? '{'.$this->dispatcher->p($node->class).'}' : $this->dispatcher->p($node->class)).'::'
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 143 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
26 1
             .($node->name instanceof Expr
27 1
                ? ($node->name instanceof Expr\Variable
28
                   || $node->name instanceof Expr\ArrayDimFetch
29
                   ? $this->dispatcher->p($node->name)
30
                   : '{'.$this->dispatcher->p($node->name).'}')
31 1
                : $node->name)
32 1
             .'('.$this->dispatcher->pCommaSeparated($node->args).')';
33
    }
34
}
35