for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace SimpleSAML\XMLSecurity\XML\ds;
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\XMLStringElementTrait;
/**
* Class representing a ds:KeyName element.
*
* @package simplesamlphp/xml-security
*/
final class KeyName extends AbstractDsElement
{
use XMLStringElementTrait;
* Validate the content of the element.
* @param string $content The value to go in the XML textContent
* @throws \Exception on failure
* @return void
protected function validateContent(string $content): void
$content
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function validateContent(/** @scrutinizer ignore-unused */ string $content): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
* Perform no validation by default.
* Override this method on the implementing class to perform content validation.
}
* Convert XML into a KeyName
* @param \DOMElement $xml The XML element we should load
* @return self
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException
* If the qualified name of the supplied element is wrong
public static function fromXML(DOMElement $xml): object
Assert::same($xml->localName, 'KeyName', InvalidDOMElementException::class);
Assert::same($xml->namespaceURI, KeyName::NS, InvalidDOMElementException::class);
return new self($xml->textContent);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.