Passed
Push — master ( fecc04...e5efab )
by Théo
03:04
created

SymfonyScoper::scope()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 5
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\Scoper;
16
17
use Humbug\PhpScoper\Scoper;
18
use Humbug\PhpScoper\Scoper\Symfony\XmlScoper as SymfonyXmlScoper;
19
use Humbug\PhpScoper\Scoper\Symfony\YamlScoper as SymfonyYamlScoper;
20
use Humbug\PhpScoper\Whitelist;
21
use PhpParser\Error as PhpParserError;
22
use function func_get_args;
23
24
/**
25
 * Scopes the Symfony configuration related files.
26
 */
27
final class SymfonyScoper implements Scoper
28
{
29
    private $decoratedScoper;
30
31
    public function __construct(Scoper $decoratedScoper)
32
    {
33
        $this->decoratedScoper = new SymfonyXmlScoper(
34
            new SymfonyYamlScoper($decoratedScoper)
35
        );
36
    }
37
38
    /**
39
     * Scopes PHP files.
40
     *
41
     * {@inheritdoc}
42
     *
43
     * @throws PhpParserError
44
     */
45
    public function scope(string $filePath, string $contents, string $prefix, array $patchers, Whitelist $whitelist): string
46
    {
47
        return $this->decoratedScoper->scope(...func_get_args());
48
    }
49
}
50