StandardPrinter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 13
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 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the humbug/php-scoper package.
7
 *
8
 * Copyright (c) 2017 Théo FIDRY <[email protected]>,
9
 *                    Pádraic Brady <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Humbug\PhpScoper\PhpParser\Printer;
16
17
use PhpParser\PrettyPrinterAbstract;
18
19
final class StandardPrinter implements Printer
20
{
21
    private PrettyPrinterAbstract $decoratedPrinter;
22
23
    public function __construct(
24
        PrettyPrinterAbstract $decoratedPrinter
25
    ) {
26
        $this->decoratedPrinter = $decoratedPrinter;
27
    }
28
29
    public function print(array $newStmts, array $oldStmts, array $oldTokens): string
30
    {
31
        return $this->decoratedPrinter->prettyPrintFile($newStmts)."\n";
32
    }
33
}
34