Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 90% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | final class ConfigurableScoper implements Scoper |
||
24 | { |
||
25 | 2 | private Scoper $decoratedScoper; |
|
26 | |||
27 | 2 | public function __construct(Scoper $decoratedScoper) |
|
28 | { |
||
29 | $this->decoratedScoper = $decoratedScoper; |
||
30 | 1 | } |
|
31 | |||
32 | 1 | public function withWhitelistedFiles(string ...$whitelistedFiles): self |
|
33 | { |
||
34 | 1 | return count($whitelistedFiles) === 0 |
|
35 | ? $this |
||
36 | 1 | : new self( |
|
37 | 1 | new FileWhitelistScoper( |
|
38 | 1 | clone $this, |
|
39 | 1 | ...$whitelistedFiles, |
|
40 | ), |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | public function scope(string $filePath, string $contents): string |
||
47 | } |
||
48 | } |
||
49 |