Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait ValidatorTrait |
||
12 | { |
||
13 | /** @var array<\SimpleSAML\SAML2\Process\ConstraintValidation\ConstraintValidatorInterface> */ |
||
14 | protected array $validators; |
||
15 | |||
16 | |||
17 | /** |
||
18 | * Add a validation to the chain. |
||
19 | * |
||
20 | * @param \SimpleSAML\SAML2\Process\ConstraintValidation\ConstraintValidatorInterface $validation |
||
21 | */ |
||
22 | public function addConstraintValidator(ConstraintValidatorInterface $validator) |
||
23 | { |
||
24 | if ($validator instanceof IdentityProviderAwareInterface) { |
||
25 | $validator->setIdentityProvider($this->idpMetadata); |
||
26 | } |
||
27 | |||
28 | if ($validator instanceof ServiceProviderAwareInterface) { |
||
29 | $validator->setServiceProvider($this->spMetadata); |
||
30 | } |
||
31 | |||
32 | $this->validators[] = $validator; |
||
33 | } |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Runs all the validations in the validation chain. |
||
38 | * |
||
39 | * If this function returns, all validations have been succesful. |
||
40 | * |
||
41 | * @throws \SimpleSAML\SAML2\Exception\ConstraintViolationFailedException when one of the conditions fail. |
||
42 | */ |
||
43 | public function validate(SerializableElementInterface $element): void |
||
47 | } |
||
48 | } |
||
50 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.