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

ArgPrinter::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;
4
5
use PhpParser\Node;
6
use PhpToZephir\Converter\SimplePrinter;
7
8
class ArgPrinter extends SimplePrinter
9
{
10
    /**
11
     * @return string
12
     */
13 1
    public static function getType()
14
    {
15 1
        return 'pArg';
16
    }
17
18
    /**
19
     * @param Node\Arg $node
20
     *
21
     * @return string
22
     */
23 26
    public function convert(Node\Arg $node)
24
    {
25 26
        if ($node->byRef) {
26
            $this->logger->logIncompatibility(
27
                'reference',
28
                'Reference not supported',
29
                $node,
30
                $this->dispatcher->getMetadata()->getClass()
31
            );
32
        }
33
34 26
        return ($node->unpack ? '...' : '').$this->dispatcher->p($node->value);
35
    }
36
}
37