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

StaticCallPrinter   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 27
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
B convert() 0 11 5
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