simplesamlphp /
xml-soap
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace SimpleSAML\SOAP12\XML; |
||
| 6 | |||
| 7 | use DOMElement; |
||
| 8 | use SimpleSAML\SOAP12\Assert\Assert; |
||
| 9 | use SimpleSAML\XML\Attribute as XMLAttribute; |
||
| 10 | use SimpleSAML\XML\SchemaValidatableElementInterface; |
||
| 11 | use SimpleSAML\XML\SchemaValidatableElementTrait; |
||
| 12 | use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; |
||
| 13 | use SimpleSAML\XMLSchema\Exception\MissingAttributeException; |
||
| 14 | use SimpleSAML\XMLSchema\Type\QNameValue; |
||
|
0 ignored issues
–
show
|
|||
| 15 | |||
| 16 | /** |
||
| 17 | * Class representing a env:NotUnderstood element. |
||
| 18 | * |
||
| 19 | * @package simplesaml/xml-soap |
||
| 20 | */ |
||
| 21 | final class NotUnderstood extends AbstractSoapElement implements SchemaValidatableElementInterface |
||
|
0 ignored issues
–
show
The type
SimpleSAML\SOAP12\XML\AbstractSoapElement 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...
|
|||
| 22 | { |
||
| 23 | use SchemaValidatableElementTrait; |
||
| 24 | |||
| 25 | |||
| 26 | /** |
||
| 27 | * Initialize a soap:NotUnderstood |
||
| 28 | * |
||
| 29 | * @param \SimpleSAML\XMLSchema\Type\QNameValue $qname |
||
| 30 | */ |
||
| 31 | public function __construct( |
||
| 32 | protected QNameValue $qname, |
||
| 33 | ) { |
||
| 34 | } |
||
| 35 | |||
| 36 | |||
| 37 | /** |
||
| 38 | * @return \SimpleSAML\XMLSchema\Type\QNameValue |
||
| 39 | */ |
||
| 40 | public function getQName(): QNameValue |
||
| 41 | { |
||
| 42 | return $this->qname; |
||
| 43 | } |
||
| 44 | |||
| 45 | |||
| 46 | /* |
||
| 47 | * Convert XML into a NotUnderstood element |
||
| 48 | * |
||
| 49 | * @param \DOMElement $xml The XML element we should load |
||
| 50 | * |
||
| 51 | * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException |
||
| 52 | * If the qualified name of the supplied element is wrong |
||
| 53 | */ |
||
| 54 | public static function fromXML(DOMElement $xml): static |
||
| 55 | { |
||
| 56 | Assert::same($xml->localName, 'NotUnderstood', InvalidDOMElementException::class); |
||
| 57 | Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); |
||
| 58 | Assert::notNull($xml->hasAttribute('qname'), MissingAttributeException::class); |
||
| 59 | |||
| 60 | return new static( |
||
| 61 | QNameValue::fromDocument($xml->getAttribute('qname'), $xml), |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | |||
| 65 | |||
| 66 | /** |
||
| 67 | * Convert this NotUnderstood to XML. |
||
| 68 | * |
||
| 69 | * @param \DOMElement|null $parent The element we should add this Body to. |
||
| 70 | */ |
||
| 71 | public function toXML(?DOMElement $parent = null): DOMElement |
||
| 72 | { |
||
| 73 | $e = $this->instantiateParentElement($parent); |
||
| 74 | |||
| 75 | if (!$e->lookupPrefix($this->getQName()->getNamespaceURI()->getValue())) { |
||
| 76 | $namespace = new XMLAttribute( |
||
| 77 | 'http://www.w3.org/2000/xmlns/', |
||
| 78 | 'xmlns', |
||
| 79 | $this->getQName()->getNamespacePrefix()->getValue(), |
||
| 80 | $this->getQName()->getNamespaceURI(), |
||
| 81 | ); |
||
| 82 | $namespace->toXML($e); |
||
| 83 | } |
||
| 84 | |||
| 85 | $e->setAttribute('qname', strval($this->getQName()->getValue())); |
||
| 86 | |||
| 87 | return $e; |
||
| 88 | } |
||
| 89 | } |
||
| 90 |
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