AbstractAllNNIValue   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateValue() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSchema\Type\Schema;
6
7
use SimpleSAML\XML\Assert\Assert;
8
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
9
use SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * @package simplesaml/xml-common
13
 */
14
abstract class AbstractAllNNIValue extends NonNegativeIntegerValue
15
{
16
    /**
17
     * Validate the value.
18
     *
19
     * @param string $value The value
20
     * @throws \Exception on failure
21
     */
22
    protected function validateValue(string $value): void
23
    {
24
        $sanitized = $this->sanitizeValue($value);
25
        if ($sanitized !== 'unbounded') {
26
            Assert::validNonNegativeInteger($sanitized, SchemaViolationException::class);
27
        }
28
    }
29
}
30