Passed
Push — master ( 44266f...d1b9e8 )
by ReliQ
04:53
created

ImportExtractor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
dl 0
loc 20
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPattern() 0 3 1
A createExtractable() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\StyleImporter\CSS\Extractor;
6
7
use ReliqArts\StyleImporter\CSS\Extractable;
8
use ReliqArts\StyleImporter\CSS\Rule\Import;
9
10
/**
11
 * Class ImportExtractor.
12
 */
13
final class ImportExtractor extends SimplePatternExtractor
14
{
15
    private const PATTERN = '/(@import[^;]+\;)/';
16
17
    /**
18
     * @return string
19
     */
20
    protected function getPattern(): string
21
    {
22
        return self::PATTERN;
23
    }
24
25
    /**
26
     * @param string $match
27
     *
28
     * @return Extractable
29
     */
30
    protected function createExtractable(string $match): Extractable
31
    {
32
        return new Import($match);
33
    }
34
}
35