simplesamlphp /
xml-cas
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace SimpleSAML\CAS\XML; |
||
| 6 | |||
| 7 | use DOMElement; |
||
| 8 | use SimpleSAML\CAS\Assert\Assert; |
||
| 9 | use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; |
||
| 10 | use SimpleSAML\XMLSchema\Exception\MissingElementException; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Class for CAS attributes |
||
| 14 | * |
||
| 15 | * @package simplesamlphp/xml-cas |
||
| 16 | */ |
||
| 17 | final class Attributes extends AbstractAttributes |
||
|
0 ignored issues
–
show
|
|||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Convert XML into a cas:attributes-element |
||
| 21 | * |
||
| 22 | * @param \DOMElement $xml The XML element we should load |
||
| 23 | * @return static |
||
| 24 | * |
||
| 25 | * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException |
||
| 26 | * if the qualified name of the supplied element is wrong |
||
| 27 | * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException |
||
| 28 | * if the supplied element is missing one of the mandatory attributes |
||
| 29 | */ |
||
| 30 | public static function fromXML(DOMElement $xml): static |
||
| 31 | { |
||
| 32 | Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); |
||
| 33 | Assert::same($xml->namespaceURI, static::getNamespaceURI(), InvalidDOMElementException::class); |
||
| 34 | |||
| 35 | $authenticationDate = AuthenticationDate::getChildrenOfClass($xml); |
||
|
0 ignored issues
–
show
The type
SimpleSAML\CAS\XML\AuthenticationDate 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 36 | Assert::count( |
||
| 37 | $authenticationDate, |
||
| 38 | 1, |
||
| 39 | 'Exactly one <cas:authenticationDate> must be specified.', |
||
| 40 | MissingElementException::class, |
||
| 41 | ); |
||
| 42 | |||
| 43 | $longTermAuthenticationRequestTokenUsed = LongTermAuthenticationRequestTokenUsed::getChildrenOfClass($xml); |
||
|
0 ignored issues
–
show
The type
SimpleSAML\CAS\XML\LongT...icationRequestTokenUsed 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 44 | Assert::count( |
||
| 45 | $longTermAuthenticationRequestTokenUsed, |
||
| 46 | 1, |
||
| 47 | 'Exactly one <cas:longTermAuthenticationRequestTokenUsed> must be specified.', |
||
| 48 | MissingElementException::class, |
||
| 49 | ); |
||
| 50 | |||
| 51 | $isFromNewLogin = IsFromNewLogin::getChildrenOfClass($xml); |
||
|
0 ignored issues
–
show
The type
SimpleSAML\CAS\XML\IsFromNewLogin 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 52 | Assert::count( |
||
| 53 | $isFromNewLogin, |
||
| 54 | 1, |
||
| 55 | 'Exactly least one <cas:isFromNewLogin> must be specified.', |
||
| 56 | MissingElementException::class, |
||
| 57 | ); |
||
| 58 | |||
| 59 | return new static( |
||
| 60 | $authenticationDate[0], |
||
| 61 | $longTermAuthenticationRequestTokenUsed[0], |
||
| 62 | $isFromNewLogin[0], |
||
| 63 | self::getChildElementsFromXML($xml), |
||
| 64 | ); |
||
| 65 | } |
||
| 66 | } |
||
| 67 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths