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

SymfonyScoper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A scope() 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\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