EntityIDTrait::validEntityID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Assert;
6
7
use SimpleSAML\SAML2\Constants as C;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\Constants 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...
8
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
9
10
use function sprintf;
11
12
/**
13
 * @package simplesamlphp/saml2
14
 */
15
trait EntityIDTrait
16
{
17
    /**
18
     */
19
    protected static function validEntityID(string $value, string $message = ''): void
0 ignored issues
show
Unused Code introduced by
The parameter $message 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

19
    protected static function validEntityID(string $value, /** @scrutinizer ignore-unused */ string $message = ''): 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...
20
    {
21
        static::validSAMLAnyURI($value);
22
23
        parent::notWhitespaceOnly($value, ProtocolViolationException::class);
24
        parent::maxLength(
25
            $value,
26
            C::ENTITYID_MAX_LENGTH,
27
            sprintf('An entityID cannot be longer than %d characters.', C::ENTITYID_MAX_LENGTH),
28
            ProtocolViolationException::class,
29
        );
30
    }
31
}
32