Passed
Push — master ( 6d2fbf...b5fd66 )
by Théo
02:44 queued 48s
created

StandardPrinter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A print() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Humbug\PhpScoper\PhpParser\Printer;
6
7
use PhpParser\PrettyPrinterAbstract;
8
9
final class StandardPrinter implements Printer
10
{
11
    private PrettyPrinterAbstract $decoratedPrinter;
12
13
    public function __construct(
14
        PrettyPrinterAbstract $decoratedPrinter
15
    ) {
16
17
        $this->decoratedPrinter = $decoratedPrinter;
18
    }
19
20
    public function print(array $statements): string
21
    {
22
        return $this->decoratedPrinter->prettyPrintFile($statements)."\n";
23
    }
24
}
25