SymfonyExtractor   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 25
rs 10
ccs 10
cts 10
cp 1
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A extract() 0 8 3
1
<?php
2
3
namespace Incenteev\TranslationCheckerBundle\Translator\Extractor;
4
5
use Symfony\Component\Translation\Extractor\ExtractorInterface as SymfonyExtractorInterface;
6
use Symfony\Component\Translation\MessageCatalogue;
7
8
class SymfonyExtractor implements ExtractorInterface
9
{
10
    private SymfonyExtractorInterface $extractor;
11
    /**
12
     * @var string[]
13 3
     */
14
    private array $paths;
15 3
16 3
    /**
17 3
     * @param string[] $paths
18
     */
19 1
    public function __construct(SymfonyExtractorInterface $extractor, array $paths)
20
    {
21 1
        $this->extractor = $extractor;
22 1
        $this->paths = $paths;
23 1
    }
24
25
    public function extract(MessageCatalogue $catalogue): void
26 1
    {
27
        foreach ($this->paths as $path) {
28 1
            if (!is_dir($path)) {
29
                continue;
30
            }
31
32
            $this->extractor->extract($path, $catalogue);
33
        }
34
    }
35
}
36