Passed
Pull Request — master (#363)
by Tim
02:37
created

ResponseValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createResponseValidator() 0 10 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Process\Validator;
6
7
use SimpleSAML\SAML2\{Binding, Metadata};
8
use SimpleSAML\SAML2\Process\ConstraintValidation\Response\{DestinationMatches, IsSuccessful};
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\Process...n\Response\IsSuccessful 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...
9
10
class ResponseValidator implements ValidatorInterface
11
{
12
    use ValidatorTrait;
13
14
    /**
15
     * @param \SimpleSAML\SAML2\Metadata\IdentityProvider  The IdP-metadata
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\Process\Validator\The 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...
16
     * @param \SimpleSAML\SAML2\Metadata\ServiceProvider  The SP-metadata
17
     */
18
    private function __construct(
19
        protected ?Metadata\IdentityProvider $idpMetadata,
20
        protected Metadata\ServiceProvider $spMetadata,
21
    ) {
22
    }
23
24
25
    /**
26
     * @param \SimpleSAML\SAML2\Metadata\IdentityProvider|null $idpMetadata
27
     * @param \SimpleSAML\SAML2\Metadata\ServiceProvider $spMetadata
28
     * @param string $binding
29
     * @return \SimpleSAML\SAML2\Validator\ResponseValidator
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\Validator\ResponseValidator 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...
30
     */
31
    public static function createResponseValidator(
32
        ?Metadata\IdentityProvider $idpMetadata,
33
        Metadata\ServiceProvider $spMetadata,
34
        Binding $binding,
35
    ): ResponseValidator {
36
        $validator = new self($idpMetadata, $spMetadata);
37
        $validator->addConstraintValidator(new DestinationMatches($spMetadata, $binding));
38
//        $validator->addConstraintValidator(new IsSuccesful());
39
40
        return $validator;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $validator returns the type SimpleSAML\SAML2\Process...dator\ResponseValidator which is incompatible with the documented return type SimpleSAML\SAML2\Validator\ResponseValidator.
Loading history...
41
    }
42
}
43