FilesToIgnore   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A validateValue() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Churn\Configuration\Validator;
6
7
use Churn\Configuration\EditableConfig;
8
use Webmozart\Assert\Assert;
9
10
/**
11
 * @internal
12
 */
13
final class FilesToIgnore extends BaseValidator
14
{
15
    /**
16
     * Class constructor.
17
     */
18
    public function __construct()
19
    {
20
        parent::__construct('filesToIgnore');
21
    }
22
23
    /**
24
     * @param EditableConfig $config The configuration object.
25
     * @param mixed $value The value to validate.
26
     */
27
    #[\Override]
28
    protected function validateValue(EditableConfig $config, $value): void
29
    {
30
        Assert::isArray($value, 'Files to ignore should be an array of strings');
31
        Assert::allString($value, 'Files to ignore should be an array of strings');
32
33
        $config->setFilesToIgnore($value);
34
    }
35
}
36