NumberingPatternTagVerifier::verify()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 2
crap 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