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

ImportExtractor::getPattern()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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