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

StaticCallPrinter::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
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