NumberingPatternTagVerifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A verify() 0 6 2
1
<?php
2
declare(strict_types=1);
3
4
namespace LSB\NumberingBundle\Service;
5
6
use LSB\NumberingBundle\Exception\NumberingGeneratorException;
7
use LSB\NumberingBundle\Model\Tag;
8
9
/**
10
 * Class NumberingPatternTagVerifier
11
 * @package LSB\NumberingBundle\Service
12
 */
13
class NumberingPatternTagVerifier
14
{
15
16
    /**
17
     * @param array $patternConfig
18
     * @param array $counterConfig
19
     * @throws NumberingGeneratorException
20
     */
21 1
    public function verify(array $patternConfig, array $counterConfig): void
0 ignored issues
show
Unused Code introduced by
The parameter $counterConfig is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

21
    public function verify(array $patternConfig, /** @scrutinizer ignore-unused */ array $counterConfig): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
    {
23
        // verify number tag
24 1
        preg_match_all(Tag::REG_EXPS[Tag::NUMBER], $patternConfig['pattern'], $matches);
25 1
        if (empty($matches[0])) {
26 1
            throw new NumberingGeneratorException(sprintf('No {%s} tag in pattern', Tag::NUMBER));
27
        }
28
29
        // TODO verify time and object context tag if necessary
30
    }
31
32
33
}
34