Passed
Push — master ( 9493b8...928281 )
by Christoffer
02:08
created

printNode()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Language;
4
5
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface;
6
7
/**
8
 * @param NodeInterface $node
9
 * @return string
10
 */
11
function printNode(NodeInterface $node): string
12
{
13
    static $instance = null;
14
15
    if (null === $instance) {
16
        $instance = new Printer();
17
    }
18
19
    return $instance->print($node);
20
}
21