From 5c728080b9db90e037f40cf8b7059209fec00a77 Mon Sep 17 00:00:00 2001 From: Pete Akins Date: Mon, 9 Dec 2024 13:00:25 -0500 Subject: [PATCH] Added explicit nullable types to satisfy PHP 8.4 deprecation --- src/SAML2/ArtifactResolve.php | 2 +- src/SAML2/ArtifactResponse.php | 4 +-- src/SAML2/Assertion.php | 30 +++++++++---------- src/SAML2/AttributeQuery.php | 2 +- src/SAML2/AuthnRequest.php | 14 ++++----- src/SAML2/Binding.php | 2 +- src/SAML2/Certificate/KeyLoader.php | 6 ++-- src/SAML2/Certificate/PrivateKey.php | 2 +- src/SAML2/Compat/AbstractContainer.php | 2 +- src/SAML2/Compat/MockContainer.php | 4 +-- src/SAML2/Compat/Ssp/Container.php | 2 +- .../Configuration/DecryptionProvider.php | 2 +- src/SAML2/Configuration/IdentityProvider.php | 2 +- src/SAML2/Configuration/ServiceProvider.php | 2 +- src/SAML2/EncryptedAssertion.php | 4 +-- src/SAML2/LogoutRequest.php | 6 ++-- src/SAML2/LogoutResponse.php | 2 +- src/SAML2/Message.php | 10 +++---- src/SAML2/Response.php | 2 +- src/SAML2/SOAPClient.php | 2 +- src/SAML2/SignedElement.php | 2 +- src/SAML2/SignedElementHelper.php | 10 +++---- src/SAML2/StatusResponse.php | 4 +-- src/SAML2/SubjectQuery.php | 4 +-- src/SAML2/Utils.php | 6 ++-- src/SAML2/XML/Chunk.php | 2 +- src/SAML2/XML/alg/DigestMethod.php | 2 +- src/SAML2/XML/alg/SigningMethod.php | 6 ++-- src/SAML2/XML/ds/KeyInfo.php | 4 +-- src/SAML2/XML/ds/KeyName.php | 2 +- src/SAML2/XML/ds/X509Certificate.php | 2 +- src/SAML2/XML/ds/X509Data.php | 2 +- src/SAML2/XML/ecp/Response.php | 2 +- .../XML/md/AdditionalMetadataLocation.php | 2 +- src/SAML2/XML/md/AffiliationDescriptor.php | 4 +-- .../XML/md/AttributeAuthorityDescriptor.php | 2 +- .../XML/md/AttributeConsumingService.php | 4 +-- src/SAML2/XML/md/AuthnAuthorityDescriptor.php | 2 +- src/SAML2/XML/md/ContactPerson.php | 8 ++--- src/SAML2/XML/md/EndpointType.php | 6 ++-- src/SAML2/XML/md/EntitiesDescriptor.php | 12 ++++---- src/SAML2/XML/md/EntityDescriptor.php | 14 ++++----- src/SAML2/XML/md/IDPSSODescriptor.php | 4 +-- src/SAML2/XML/md/IndexedEndpointType.php | 4 +-- src/SAML2/XML/md/KeyDescriptor.php | 4 +-- src/SAML2/XML/md/Organization.php | 2 +- src/SAML2/XML/md/PDPDescriptor.php | 2 +- src/SAML2/XML/md/RequestedAttribute.php | 4 +-- src/SAML2/XML/md/RoleDescriptor.php | 12 ++++---- src/SAML2/XML/md/SPSSODescriptor.php | 6 ++-- src/SAML2/XML/md/SSODescriptorType.php | 2 +- src/SAML2/XML/mdattr/EntityAttributes.php | 2 +- src/SAML2/XML/mdrpi/PublicationInfo.php | 6 ++-- src/SAML2/XML/mdrpi/RegistrationInfo.php | 4 +-- src/SAML2/XML/mdui/DiscoHints.php | 2 +- src/SAML2/XML/mdui/Keywords.php | 2 +- src/SAML2/XML/mdui/Logo.php | 2 +- src/SAML2/XML/mdui/UIInfo.php | 2 +- src/SAML2/XML/saml/Attribute.php | 6 ++-- src/SAML2/XML/saml/BaseIDType.php | 4 +-- src/SAML2/XML/saml/IDNameQualifiersTrait.php | 4 +-- src/SAML2/XML/saml/Issuer.php | 4 +-- src/SAML2/XML/saml/NameIDType.php | 8 ++--- src/SAML2/XML/saml/SubjectConfirmation.php | 6 ++-- .../XML/saml/SubjectConfirmationData.php | 12 ++++---- src/SAML2/XML/shibmd/Scope.php | 2 +- 66 files changed, 155 insertions(+), 155 deletions(-) diff --git a/src/SAML2/ArtifactResolve.php b/src/SAML2/ArtifactResolve.php index 651864e92..1e1d8fd29 100644 --- a/src/SAML2/ArtifactResolve.php +++ b/src/SAML2/ArtifactResolve.php @@ -25,7 +25,7 @@ class ArtifactResolve extends Request * * @param \DOMElement|null $xml The input assertion. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('ArtifactResolve', $xml); diff --git a/src/SAML2/ArtifactResponse.php b/src/SAML2/ArtifactResponse.php index f398c3d49..a23eb6cc5 100644 --- a/src/SAML2/ArtifactResponse.php +++ b/src/SAML2/ArtifactResponse.php @@ -30,7 +30,7 @@ class ArtifactResponse extends StatusResponse * @param \DOMElement|null $xml The input assertion. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('ArtifactResponse', $xml); @@ -54,7 +54,7 @@ public function __construct(DOMElement $xml = null) * @param \DOMElement|null $any * @return void */ - public function setAny(DOMElement $any = null) : void + public function setAny(?DOMElement $any = null) : void { $this->any = $any; } diff --git a/src/SAML2/Assertion.php b/src/SAML2/Assertion.php index 48f1b4cbc..78344f11b 100644 --- a/src/SAML2/Assertion.php +++ b/src/SAML2/Assertion.php @@ -247,7 +247,7 @@ class Assertion extends SignedElement * @param \DOMElement|null $xml The input assertion. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { // Create an Issuer $issuer = new Issuer(); @@ -771,7 +771,7 @@ public function getNameId() : ?NameID * @param \SAML2\XML\saml\NameID|null $nameId The name identifier of the assertion. * @return void */ - public function setNameId(NameID $nameId = null) : void + public function setNameId(?NameID $nameId = null) : void { $this->nameId = $nameId; } @@ -937,7 +937,7 @@ public function getNotBefore() : ?int * @param int|null $notBefore The earliest timestamp this assertion is valid. * @return void */ - public function setNotBefore(int $notBefore = null) : void + public function setNotBefore(?int $notBefore = null) : void { $this->notBefore = $notBefore; } @@ -965,7 +965,7 @@ public function getNotOnOrAfter() : ?int * @param int|null $notOnOrAfter The latest timestamp this assertion is valid. * @return void */ - public function setNotOnOrAfter(int $notOnOrAfter = null) : void + public function setNotOnOrAfter(?int $notOnOrAfter = null) : void { $this->notOnOrAfter = $notOnOrAfter; } @@ -1015,7 +1015,7 @@ public function getValidAudiences() : ?array * @param array|null $validAudiences The allowed audiences. * @return void */ - public function setValidAudiences(array $validAudiences = null) : void + public function setValidAudiences(?array $validAudiences = null) : void { $this->validAudiences = $validAudiences; } @@ -1038,7 +1038,7 @@ public function getAuthnInstant() : ?int * @param int|null $authnInstant Timestamp the user was authenticated, or NULL if we don't want an AuthnStatement. * @return void */ - public function setAuthnInstant(int $authnInstant = null) : void + public function setAuthnInstant(?int $authnInstant = null) : void { $this->authnInstant = $authnInstant; } @@ -1066,7 +1066,7 @@ public function getSessionNotOnOrAfter() : ?int * @param int|null $sessionNotOnOrAfter The latest timestamp this session is valid. * @return void */ - public function setSessionNotOnOrAfter(int $sessionNotOnOrAfter = null) : void + public function setSessionNotOnOrAfter(?int $sessionNotOnOrAfter = null) : void { $this->sessionNotOnOrAfter = $sessionNotOnOrAfter; } @@ -1092,7 +1092,7 @@ public function getSessionIndex() : ?string * @param string|null $sessionIndex The session index of the user at the IdP. * @return void */ - public function setSessionIndex(string $sessionIndex = null) : void + public function setSessionIndex(?string $sessionIndex = null) : void { $this->sessionIndex = $sessionIndex; } @@ -1121,7 +1121,7 @@ public function getAuthnContextClassRef() : ?string * @param string|null $authnContextClassRef The authentication method. * @return void */ - public function setAuthnContextClassRef(string $authnContextClassRef = null) : void + public function setAuthnContextClassRef(?string $authnContextClassRef = null) : void { $this->authnContextClassRef = $authnContextClassRef; } @@ -1144,7 +1144,7 @@ public function getSignatureMethod() : ?string * @param string|null $signatureMethod * @return void */ - public function setSignatureMethod(string $signatureMethod = null) : void + public function setSignatureMethod(?string $signatureMethod = null) : void { $this->signatureMethod = $signatureMethod; } @@ -1190,7 +1190,7 @@ public function getAuthnContextDecl() : ?Chunk * @throws \Exception * @return void */ - public function setAuthnContextDeclRef(string $authnContextDeclRef = null) : void + public function setAuthnContextDeclRef(?string $authnContextDeclRef = null) : void { if (!empty($this->authnContextDecl)) { throw new \Exception( @@ -1274,7 +1274,7 @@ public function getSignatureData() : ?array * @param array|null $signatureData * @return void */ - public function setSignatureData(array $signatureData = null) : void + public function setSignatureData(?array $signatureData = null) : void { $this->signatureData = $signatureData; } @@ -1394,7 +1394,7 @@ public function getSignatureKey() : ?XMLSecurityKey * @param XMLSecurityKey|null $signatureKey * @return void */ - public function setSignatureKey(XMLSecurityKey $signatureKey = null) : void + public function setSignatureKey(?XMLSecurityKey $signatureKey = null) : void { $this->signatureKey = $signatureKey; } @@ -1418,7 +1418,7 @@ public function getEncryptionKey() : ?XMLSecurityKey * @param XMLSecurityKey|null $Key * @return void */ - public function setEncryptionKey(XMLSecurityKey $Key = null) : void + public function setEncryptionKey(?XMLSecurityKey $Key = null) : void { $this->encryptionKey = $Key; } @@ -1464,7 +1464,7 @@ public function wasSignedAtConstruction() : bool * @param \DOMNode|null $parentElement The DOM node the assertion should be created in. * @return \DOMElement This assertion. */ - public function toXML(\DOMNode $parentElement = null) : DOMElement + public function toXML(?\DOMNode $parentElement = null) : DOMElement { if ($parentElement === null) { $document = DOMDocumentFactory::create(); diff --git a/src/SAML2/AttributeQuery.php b/src/SAML2/AttributeQuery.php index 8102aa236..fe0a24682 100644 --- a/src/SAML2/AttributeQuery.php +++ b/src/SAML2/AttributeQuery.php @@ -47,7 +47,7 @@ class AttributeQuery extends SubjectQuery * @param \DOMElement|null $xml The input message. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('AttributeQuery', $xml); diff --git a/src/SAML2/AuthnRequest.php b/src/SAML2/AuthnRequest.php index a3756a46b..85174caa7 100644 --- a/src/SAML2/AuthnRequest.php +++ b/src/SAML2/AuthnRequest.php @@ -139,7 +139,7 @@ class AuthnRequest extends Request * @param \DOMElement|null $xml The input message. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('AuthnRequest', $xml); @@ -567,7 +567,7 @@ public function getAssertionConsumerServiceURL() : ?string * @param string|null $assertionConsumerServiceURL The AssertionConsumerServiceURL attribute. * @return void */ - public function setAssertionConsumerServiceURL(string $assertionConsumerServiceURL = null) : void + public function setAssertionConsumerServiceURL(?string $assertionConsumerServiceURL = null) : void { $this->assertionConsumerServiceURL = $assertionConsumerServiceURL; } @@ -590,7 +590,7 @@ public function getProtocolBinding() : ?string * @param string $protocolBinding The ProtocolBinding attribute. * @return void */ - public function setProtocolBinding(string $protocolBinding = null) : void + public function setProtocolBinding(?string $protocolBinding = null) : void { $this->protocolBinding = $protocolBinding; } @@ -613,7 +613,7 @@ public function getAttributeConsumingServiceIndex() : ?int * @param int|null $attributeConsumingServiceIndex The AttributeConsumingServiceIndex attribute. * @return void */ - public function setAttributeConsumingServiceIndex(int $attributeConsumingServiceIndex = null) : void + public function setAttributeConsumingServiceIndex(?int $attributeConsumingServiceIndex = null) : void { $this->attributeConsumingServiceIndex = $attributeConsumingServiceIndex; } @@ -636,7 +636,7 @@ public function getAssertionConsumerServiceIndex() : ?int * @param int|null $assertionConsumerServiceIndex The AssertionConsumerServiceIndex attribute. * @return void */ - public function setAssertionConsumerServiceIndex(int $assertionConsumerServiceIndex = null) : void + public function setAssertionConsumerServiceIndex(?int $assertionConsumerServiceIndex = null) : void { $this->assertionConsumerServiceIndex = $assertionConsumerServiceIndex; } @@ -659,7 +659,7 @@ public function getRequestedAuthnContext() : ?array * @param array|null $requestedAuthnContext The RequestedAuthnContext. * @return void */ - public function setRequestedAuthnContext(array $requestedAuthnContext = null) : void + public function setRequestedAuthnContext(?array $requestedAuthnContext = null) : void { $this->requestedAuthnContext = $requestedAuthnContext; } @@ -687,7 +687,7 @@ public function getNameId() : ?NameID * @param \SAML2\XML\saml\NameID|null $nameId The name identifier of the assertion. * @return void */ - public function setNameId(NameID $nameId = null) : void + public function setNameId(?NameID $nameId = null) : void { $this->nameId = $nameId; } diff --git a/src/SAML2/Binding.php b/src/SAML2/Binding.php index 48552da7a..b303a3f9a 100644 --- a/src/SAML2/Binding.php +++ b/src/SAML2/Binding.php @@ -137,7 +137,7 @@ public function getDestination() : ?string * @param string|null $destination The destination the message should be delivered to. * @return void */ - public function setDestination(string $destination = null) : void + public function setDestination(?string $destination = null) : void { $this->destination = $destination; } diff --git a/src/SAML2/Certificate/KeyLoader.php b/src/SAML2/Certificate/KeyLoader.php index 679c8b4df..8b5ff999b 100644 --- a/src/SAML2/Certificate/KeyLoader.php +++ b/src/SAML2/Certificate/KeyLoader.php @@ -43,7 +43,7 @@ public function __construct() */ public static function extractPublicKeys( CertificateProvider $config, - string $usage = null, + ?string $usage = null, bool $required = false ) : KeyCollection { $keyLoader = new self(); @@ -60,7 +60,7 @@ public static function extractPublicKeys( */ public function loadKeysFromConfiguration( CertificateProvider $config, - string $usage = null, + ?string $usage = null, bool $required = false ) : KeyCollection { $keys = $config->getKeys(); @@ -94,7 +94,7 @@ public function loadKeysFromConfiguration( * @param string|null $usage * @return void */ - public function loadKeys($configuredKeys, string $usage = null) : void + public function loadKeys($configuredKeys, ?string $usage = null) : void { foreach ($configuredKeys as $keyData) { if (isset($keyData['X509Certificate'])) { diff --git a/src/SAML2/Certificate/PrivateKey.php b/src/SAML2/Certificate/PrivateKey.php index 3b7f56289..a3313f823 100644 --- a/src/SAML2/Certificate/PrivateKey.php +++ b/src/SAML2/Certificate/PrivateKey.php @@ -14,7 +14,7 @@ class PrivateKey extends Key * @throws InvalidArgumentException * @return PrivateKey */ - public static function create(string $keyContents, string $passphrase = null) : PrivateKey + public static function create(string $keyContents, ?string $passphrase = null) : PrivateKey { $keyData = ['PEM' => $keyContents, self::USAGE_ENCRYPTION => true]; if ($passphrase) { diff --git a/src/SAML2/Compat/AbstractContainer.php b/src/SAML2/Compat/AbstractContainer.php index e6b0ac98b..0dd12734d 100644 --- a/src/SAML2/Compat/AbstractContainer.php +++ b/src/SAML2/Compat/AbstractContainer.php @@ -80,5 +80,5 @@ abstract public function getTempDir() : string; * @param int $mode The permissions to apply to the file. Defaults to 0600. * @return void */ - abstract public function writeFile(string $filename, string $data, int $mode = null) : void; + abstract public function writeFile(string $filename, string $data, ?int $mode = null) : void; } diff --git a/src/SAML2/Compat/MockContainer.php b/src/SAML2/Compat/MockContainer.php index bc71076d3..7920ae1ab 100644 --- a/src/SAML2/Compat/MockContainer.php +++ b/src/SAML2/Compat/MockContainer.php @@ -103,7 +103,7 @@ public function redirect(string $url, array $data = []) : void * @param array $data * @return void */ - public function postRedirect(string $url = null, array $data = []) : void + public function postRedirect(?string $url = null, array $data = []) : void { $this->postRedirectUrl = $url; $this->postRedirectData = $data; @@ -125,7 +125,7 @@ public function getTempDir() : string * @param int|null $mode * @return void */ - public function writeFile(string $filename, string $data, int $mode = null) : void + public function writeFile(string $filename, string $data, ?int $mode = null) : void { if ($mode === null) { $mode = 0600; diff --git a/src/SAML2/Compat/Ssp/Container.php b/src/SAML2/Compat/Ssp/Container.php index 10e179e16..437b418ae 100644 --- a/src/SAML2/Compat/Ssp/Container.php +++ b/src/SAML2/Compat/Ssp/Container.php @@ -125,7 +125,7 @@ public function getTempDir() : string * @param int|null $mode * @return void */ - public function writeFile(string $filename, string $data, int $mode = null) : void + public function writeFile(string $filename, string $data, ?int $mode = null) : void { if ($mode === null) { $mode = 0600; diff --git a/src/SAML2/Configuration/DecryptionProvider.php b/src/SAML2/Configuration/DecryptionProvider.php index 408fd01ee..81535f363 100644 --- a/src/SAML2/Configuration/DecryptionProvider.php +++ b/src/SAML2/Configuration/DecryptionProvider.php @@ -24,7 +24,7 @@ public function getSharedKey() : ?string; * * @return mixed */ - public function getPrivateKey(string $name, bool $required = null); + public function getPrivateKey(string $name, ?bool $required = null); diff --git a/src/SAML2/Configuration/IdentityProvider.php b/src/SAML2/Configuration/IdentityProvider.php index 366b37196..4f35ffd73 100644 --- a/src/SAML2/Configuration/IdentityProvider.php +++ b/src/SAML2/Configuration/IdentityProvider.php @@ -77,7 +77,7 @@ public function hasBase64EncodedAttributes() * @param bool $required * @return mixed|null */ - public function getPrivateKey(string $name, bool $required = null) + public function getPrivateKey(string $name, ?bool $required = null) { if ($required === null) { $required = false; diff --git a/src/SAML2/Configuration/ServiceProvider.php b/src/SAML2/Configuration/ServiceProvider.php index 72c40a3cb..6a26d73db 100644 --- a/src/SAML2/Configuration/ServiceProvider.php +++ b/src/SAML2/Configuration/ServiceProvider.php @@ -79,7 +79,7 @@ public function getSharedKey() : ?string * @param bool $required * @return mixed|null */ - public function getPrivateKey(string $name, bool $required = null) + public function getPrivateKey(string $name, ?bool $required = null) { if ($required === null) { $required = false; diff --git a/src/SAML2/EncryptedAssertion.php b/src/SAML2/EncryptedAssertion.php index fde149ac2..cc74e0031 100644 --- a/src/SAML2/EncryptedAssertion.php +++ b/src/SAML2/EncryptedAssertion.php @@ -35,7 +35,7 @@ class EncryptedAssertion * @param \DOMElement|null $xml The encrypted assertion XML element. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -133,7 +133,7 @@ public function getAssertion(XMLSecurityKey $inputKey, array $blacklist = []) : * @param \DOMNode|null $parentElement The DOM node the assertion should be created in. * @return \DOMElement This encrypted assertion. */ - public function toXML(DOMNode $parentElement = null) : DOMElement + public function toXML(?DOMNode $parentElement = null) : DOMElement { if ($parentElement === null) { $document = DOMDocumentFactory::create(); diff --git a/src/SAML2/LogoutRequest.php b/src/SAML2/LogoutRequest.php index 2ad66d435..186cf052f 100644 --- a/src/SAML2/LogoutRequest.php +++ b/src/SAML2/LogoutRequest.php @@ -63,7 +63,7 @@ class LogoutRequest extends Request * @param \DOMElement|null $xml The input message. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('LogoutRequest', $xml); @@ -120,7 +120,7 @@ public function getNotOnOrAfter() : ?int * @param int|null $notOnOrAfter The expiration time of this request. * @return void */ - public function setNotOnOrAfter(int $notOnOrAfter = null) : void + public function setNotOnOrAfter(?int $notOnOrAfter = null) : void { $this->notOnOrAfter = $notOnOrAfter; } @@ -295,7 +295,7 @@ public function getSessionIndex() : ?string * @param string|null $sessionIndex The sesion index of the session that should be terminated. * @return void */ - public function setSessionIndex(string $sessionIndex = null) : void + public function setSessionIndex(?string $sessionIndex = null) : void { if (is_null($sessionIndex)) { $this->sessionIndexes = []; diff --git a/src/SAML2/LogoutResponse.php b/src/SAML2/LogoutResponse.php index c588fad84..5f604610e 100644 --- a/src/SAML2/LogoutResponse.php +++ b/src/SAML2/LogoutResponse.php @@ -18,7 +18,7 @@ class LogoutResponse extends StatusResponse * * @param \DOMElement|null $xml The input message. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('LogoutResponse', $xml); diff --git a/src/SAML2/Message.php b/src/SAML2/Message.php index 9819445cb..dbc5f3950 100644 --- a/src/SAML2/Message.php +++ b/src/SAML2/Message.php @@ -136,7 +136,7 @@ abstract class Message extends SignedElement * * @throws \Exception */ - protected function __construct(string $tagName, DOMElement $xml = null) + protected function __construct(string $tagName, ?DOMElement $xml = null) { $this->tagName = $tagName; @@ -337,7 +337,7 @@ public function getDestination() : ?string * @param string|null $destination The new destination of this message * @return void */ - public function setDestination(string $destination = null) : void + public function setDestination(?string $destination = null) : void { $this->destination = $destination; } @@ -387,7 +387,7 @@ public function getIssuer() : ?Issuer * @param \SAML2\XML\saml\Issuer|null $issuer The new issuer of this message * @return void */ - public function setIssuer(Issuer $issuer = null) : void + public function setIssuer(?Issuer $issuer = null) : void { $this->issuer = $issuer; } @@ -421,7 +421,7 @@ public function getRelayState() : ?string * @param string|null $relayState The new RelayState * @return void */ - public function setRelayState(string $relayState = null) : void + public function setRelayState(?string $relayState = null) : void { $this->relayState = $relayState; } @@ -520,7 +520,7 @@ public function getSignatureKey() : ?XMLSecurityKey * @param XMLSecurityKey|null $signatureKey * @return void */ - public function setSignatureKey(XMLSecurityKey $signatureKey = null) : void + public function setSignatureKey(?XMLSecurityKey $signatureKey = null) : void { $this->signatureKey = $signatureKey; } diff --git a/src/SAML2/Response.php b/src/SAML2/Response.php index fc5078750..330b26382 100644 --- a/src/SAML2/Response.php +++ b/src/SAML2/Response.php @@ -26,7 +26,7 @@ class Response extends StatusResponse * * @param \DOMElement|null $xml The input message. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('Response', $xml); diff --git a/src/SAML2/SOAPClient.php b/src/SAML2/SOAPClient.php index 1a33d7129..b3f22c443 100644 --- a/src/SAML2/SOAPClient.php +++ b/src/SAML2/SOAPClient.php @@ -41,7 +41,7 @@ class SOAPClient * * @psalm-suppress UndefinedClass */ - public function send(Message $msg, Configuration $srcMetadata, Configuration $dstMetadata = null) : Message + public function send(Message $msg, Configuration $srcMetadata, ?Configuration $dstMetadata = null) : Message { $issuer = $msg->getIssuer(); diff --git a/src/SAML2/SignedElement.php b/src/SAML2/SignedElement.php index b7a683584..f906bb86b 100644 --- a/src/SAML2/SignedElement.php +++ b/src/SAML2/SignedElement.php @@ -85,7 +85,7 @@ public function getSignatureKey() : ?XMLSecurityKey * @param XMLSecurityKey|null $signatureKey * @return void */ - public function setSignatureKey(XMLSecurityKey $signatureKey = null) : void + public function setSignatureKey(?XMLSecurityKey $signatureKey = null) : void { $this->signatureKey = $signatureKey; } diff --git a/src/SAML2/SignedElementHelper.php b/src/SAML2/SignedElementHelper.php index 47e87d97f..ce05b7b33 100644 --- a/src/SAML2/SignedElementHelper.php +++ b/src/SAML2/SignedElementHelper.php @@ -44,7 +44,7 @@ class SignedElementHelper extends SignedElement * * @param \DOMElement|null $xml The XML element which may be signed. */ - protected function __construct(DOMElement $xml = null) + protected function __construct(?DOMElement $xml = null) { $this->certificates = []; $this->validators = []; @@ -146,7 +146,7 @@ public function getSignatureKey() : ?XMLSecurityKey * @param XMLSecurityKey|null $signatureKey * @return void */ - public function setSignatureKey(XMLSecurityKey $signatureKey = null) : void + public function setSignatureKey(?XMLSecurityKey $signatureKey = null) : void { $this->signatureKey = $signatureKey; } @@ -225,7 +225,7 @@ public function getValidUntil() : ?int * @param int|null $validUntil * @return void */ - public function setValidUntil(int $validUntil = null) : void + public function setValidUntil(?int $validUntil = null) : void { $this->validUntil = $validUntil; } @@ -248,7 +248,7 @@ public function getCacheDuration() : ?string * @param string|null $cacheDuration * @return void */ - public function setCacheDuration(string $cacheDuration = null) : void + public function setCacheDuration(?string $cacheDuration = null) : void { $this->cacheDuration = $cacheDuration; } @@ -261,7 +261,7 @@ public function setCacheDuration(string $cacheDuration = null) : void * @param \DOMNode|null $insertBefore The element we should insert the signature node before. * @return \DOMElement|null */ - protected function signElement(DOMElement $root, DOMNode $insertBefore = null) : ?DOMElement + protected function signElement(DOMElement $root, ?DOMNode $insertBefore = null) : ?DOMElement { if ($this->signatureKey === null) { /* We cannot sign this element. */ diff --git a/src/SAML2/StatusResponse.php b/src/SAML2/StatusResponse.php index 885bbc4b3..0ed02e78d 100644 --- a/src/SAML2/StatusResponse.php +++ b/src/SAML2/StatusResponse.php @@ -52,7 +52,7 @@ abstract class StatusResponse extends Message * @param \DOMElement|null $xml The input message. * @throws \Exception */ - protected function __construct(string $tagName, DOMElement $xml = null) + protected function __construct(string $tagName, ?DOMElement $xml = null) { parent::__construct($tagName, $xml); @@ -127,7 +127,7 @@ public function getInResponseTo() : ?string * @param string|null $inResponseTo The ID of the request. * @return void */ - public function setInResponseTo(string $inResponseTo = null) : void + public function setInResponseTo(?string $inResponseTo = null) : void { $this->inResponseTo = $inResponseTo; } diff --git a/src/SAML2/SubjectQuery.php b/src/SAML2/SubjectQuery.php index 7d025d94e..99aba4a9c 100644 --- a/src/SAML2/SubjectQuery.php +++ b/src/SAML2/SubjectQuery.php @@ -35,7 +35,7 @@ abstract class SubjectQuery extends Request * @param string $tagName The tag name of the root element. * @param \DOMElement|null $xml The input message. */ - protected function __construct(string $tagName, DOMElement $xml = null) + protected function __construct(string $tagName, ?DOMElement $xml = null) { parent::__construct($tagName, $xml); @@ -92,7 +92,7 @@ public function getNameId() : ?NameID * @param \SAML2\XML\saml\NameID|null $nameId The name identifier of the assertion. * @return void */ - public function setNameId(NameID $nameId = null) : void + public function setNameId(?NameID $nameId = null) : void { $this->nameId = $nameId; } diff --git a/src/SAML2/Utils.php b/src/SAML2/Utils.php index 2d84dd480..3d55dd0c8 100644 --- a/src/SAML2/Utils.php +++ b/src/SAML2/Utils.php @@ -120,7 +120,7 @@ public static function validateElement(DOMElement $root) * @param string $type Public or private key, defaults to public. * @return XMLSecurityKey The new key. */ - public static function castKey(XMLSecurityKey $key, string $algorithm, string $type = null) : XMLSecurityKey + public static function castKey(XMLSecurityKey $key, string $algorithm, ?string $type = null) : XMLSecurityKey { $type = $type ?: 'public'; Assert::oneOf($type, ["private", "public"]); @@ -242,7 +242,7 @@ public static function xpQuery(DOMNode $node, string $query) : array * @param \DOMElement|null $parent The target parent element. * @return \DOMElement The copied element. */ - public static function copyElement(DOMElement $element, DOMElement $parent = null) : DOMElement + public static function copyElement(DOMElement $element, ?DOMElement $parent = null) : DOMElement { if ($parent === null) { $document = DOMDocumentFactory::create(); @@ -321,7 +321,7 @@ public static function insertSignature( XMLSecurityKey $key, array $certificates, DOMElement $root, - DOMNode $insertBefore = null + ?DOMNode $insertBefore = null ) : void { $objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); diff --git a/src/SAML2/XML/Chunk.php b/src/SAML2/XML/Chunk.php index 72db68a55..84b2d3d03 100644 --- a/src/SAML2/XML/Chunk.php +++ b/src/SAML2/XML/Chunk.php @@ -116,7 +116,7 @@ public function getNamespaceURI() : ?string * @param string|null $namespaceURI * @return void */ - public function setNamespaceURI(string $namespaceURI = null) : void + public function setNamespaceURI(?string $namespaceURI = null) : void { $this->namespaceURI = $namespaceURI; } diff --git a/src/SAML2/XML/alg/DigestMethod.php b/src/SAML2/XML/alg/DigestMethod.php index 196ab9c01..d257ad540 100644 --- a/src/SAML2/XML/alg/DigestMethod.php +++ b/src/SAML2/XML/alg/DigestMethod.php @@ -31,7 +31,7 @@ class DigestMethod * * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/alg/SigningMethod.php b/src/SAML2/XML/alg/SigningMethod.php index 3719c566a..79485a12a 100644 --- a/src/SAML2/XML/alg/SigningMethod.php +++ b/src/SAML2/XML/alg/SigningMethod.php @@ -47,7 +47,7 @@ class SigningMethod * * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -108,7 +108,7 @@ public function getMinKeySize() : ?int * @param int|null $minKeySize * @return void */ - public function setMinKeySize(int $minKeySize = null) : void + public function setMinKeySize(?int $minKeySize = null) : void { $this->MinKeySize = $minKeySize; } @@ -131,7 +131,7 @@ public function getMaxKeySize() : ?int * @param int|null $maxKeySize * @return void */ - public function setMaxKeySize(int $maxKeySize = null) : void + public function setMaxKeySize(?int $maxKeySize = null) : void { $this->MaxKeySize = $maxKeySize; } diff --git a/src/SAML2/XML/ds/KeyInfo.php b/src/SAML2/XML/ds/KeyInfo.php index f53c5f4d4..be216c9c4 100644 --- a/src/SAML2/XML/ds/KeyInfo.php +++ b/src/SAML2/XML/ds/KeyInfo.php @@ -40,7 +40,7 @@ class KeyInfo * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -91,7 +91,7 @@ public function getId() : ?string * @param string|null $id * @return void */ - public function setId(string $id = null) : void + public function setId(?string $id = null) : void { $this->Id = $id; } diff --git a/src/SAML2/XML/ds/KeyName.php b/src/SAML2/XML/ds/KeyName.php index b025f1a27..6994a0360 100644 --- a/src/SAML2/XML/ds/KeyName.php +++ b/src/SAML2/XML/ds/KeyName.php @@ -29,7 +29,7 @@ class KeyName * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/ds/X509Certificate.php b/src/SAML2/XML/ds/X509Certificate.php index 979c16343..665c40652 100644 --- a/src/SAML2/XML/ds/X509Certificate.php +++ b/src/SAML2/XML/ds/X509Certificate.php @@ -29,7 +29,7 @@ class X509Certificate * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/ds/X509Data.php b/src/SAML2/XML/ds/X509Data.php index f5d1cdec0..c09328391 100644 --- a/src/SAML2/XML/ds/X509Data.php +++ b/src/SAML2/XML/ds/X509Data.php @@ -34,7 +34,7 @@ class X509Data * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/ecp/Response.php b/src/SAML2/XML/ecp/Response.php index ab4558e93..b5437c071 100644 --- a/src/SAML2/XML/ecp/Response.php +++ b/src/SAML2/XML/ecp/Response.php @@ -27,7 +27,7 @@ class Response * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/md/AdditionalMetadataLocation.php b/src/SAML2/XML/md/AdditionalMetadataLocation.php index 55fab5966..83c2da530 100644 --- a/src/SAML2/XML/md/AdditionalMetadataLocation.php +++ b/src/SAML2/XML/md/AdditionalMetadataLocation.php @@ -37,7 +37,7 @@ class AdditionalMetadataLocation * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/md/AffiliationDescriptor.php b/src/SAML2/XML/md/AffiliationDescriptor.php index 5cd06822b..f8ec48244 100644 --- a/src/SAML2/XML/md/AffiliationDescriptor.php +++ b/src/SAML2/XML/md/AffiliationDescriptor.php @@ -66,7 +66,7 @@ class AffiliationDescriptor extends SignedElementHelper * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct($xml); @@ -145,7 +145,7 @@ public function getID() : ?string * @param string|null $Id * @return void */ - public function setID(string $Id = null) : void + public function setID(?string $Id = null) : void { $this->ID = $Id; } diff --git a/src/SAML2/XML/md/AttributeAuthorityDescriptor.php b/src/SAML2/XML/md/AttributeAuthorityDescriptor.php index 1d3132356..7ac5a3cd5 100644 --- a/src/SAML2/XML/md/AttributeAuthorityDescriptor.php +++ b/src/SAML2/XML/md/AttributeAuthorityDescriptor.php @@ -70,7 +70,7 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('md:AttributeAuthorityDescriptor', $xml); diff --git a/src/SAML2/XML/md/AttributeConsumingService.php b/src/SAML2/XML/md/AttributeConsumingService.php index 82162e57f..3a12f7277 100644 --- a/src/SAML2/XML/md/AttributeConsumingService.php +++ b/src/SAML2/XML/md/AttributeConsumingService.php @@ -64,7 +64,7 @@ class AttributeConsumingService * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -131,7 +131,7 @@ public function getIsDefault() : ?bool * @param bool|null $flag * @return void */ - public function setIsDefault(bool $flag = null) : void + public function setIsDefault(?bool $flag = null) : void { $this->isDefault = $flag; } diff --git a/src/SAML2/XML/md/AuthnAuthorityDescriptor.php b/src/SAML2/XML/md/AuthnAuthorityDescriptor.php index 89ddd80d6..a8c4bd7a0 100644 --- a/src/SAML2/XML/md/AuthnAuthorityDescriptor.php +++ b/src/SAML2/XML/md/AuthnAuthorityDescriptor.php @@ -51,7 +51,7 @@ class AuthnAuthorityDescriptor extends RoleDescriptor * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('md:AuthnAuthorityDescriptor', $xml); diff --git a/src/SAML2/XML/md/ContactPerson.php b/src/SAML2/XML/md/ContactPerson.php index 7e230a71a..8af663497 100644 --- a/src/SAML2/XML/md/ContactPerson.php +++ b/src/SAML2/XML/md/ContactPerson.php @@ -93,7 +93,7 @@ class ContactPerson * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -204,7 +204,7 @@ public function getCompany() : ?string * @param string|null $company * @return void */ - public function setCompany(string $company = null) : void + public function setCompany(?string $company = null) : void { $this->Company = $company; } @@ -227,7 +227,7 @@ public function getGivenName() : ?string * @param string|null $givenName * @return void */ - public function setGivenName(string $givenName = null) : void + public function setGivenName(?string $givenName = null) : void { $this->GivenName = $givenName; } @@ -250,7 +250,7 @@ public function getSurName() : ?string * @param string|null $surName * @return void */ - public function setSurName(string $surName = null) : void + public function setSurName(?string $surName = null) : void { $this->SurName = $surName; } diff --git a/src/SAML2/XML/md/EndpointType.php b/src/SAML2/XML/md/EndpointType.php index 7b0832d2a..ab4e986d2 100644 --- a/src/SAML2/XML/md/EndpointType.php +++ b/src/SAML2/XML/md/EndpointType.php @@ -50,7 +50,7 @@ class EndpointType * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -196,7 +196,7 @@ public function getLocation() : ?string * @param string|null $location * @return void */ - public function setLocation(string $location = null) : void + public function setLocation(?string $location = null) : void { $this->Location = $location; } @@ -219,7 +219,7 @@ public function getResponseLocation() : ?string * @param string|null $responseLocation * @return void */ - public function setResponseLocation(string $responseLocation = null) : void + public function setResponseLocation(?string $responseLocation = null) : void { $this->ResponseLocation = $responseLocation; } diff --git a/src/SAML2/XML/md/EntitiesDescriptor.php b/src/SAML2/XML/md/EntitiesDescriptor.php index a1b1cce25..5eacdd46b 100644 --- a/src/SAML2/XML/md/EntitiesDescriptor.php +++ b/src/SAML2/XML/md/EntitiesDescriptor.php @@ -56,7 +56,7 @@ class EntitiesDescriptor extends SignedElementHelper * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct($xml); @@ -107,7 +107,7 @@ public function getName() : ?string * @param string|null $name * @return void */ - public function setName(string $name = null) : void + public function setName(?string $name = null) : void { $this->Name = $name; } @@ -130,7 +130,7 @@ public function getID() : ?string * @param string|null $Id * @return void */ - public function setID(string $Id = null) : void + public function setID(?string $Id = null) : void { $this->ID = $Id; } @@ -151,7 +151,7 @@ public function getValidUntil() : ?int * @param int|null $validUntil * @return void */ - public function setValidUntil(int $validUntil = null) : void + public function setValidUntil(?int $validUntil = null) : void { $this->validUntil = $validUntil; } @@ -172,7 +172,7 @@ public function getCacheDuration() : ?string * @param string|null $cacheDuration * @return void */ - public function setCacheDuration(string $cacheDuration = null) : void + public function setCacheDuration(?string $cacheDuration = null) : void { $this->cacheDuration = $cacheDuration; } @@ -255,7 +255,7 @@ public function addChildren($child) : void * @param \DOMElement|null $parent The EntitiesDescriptor we should append this EntitiesDescriptor to. * @return \DOMElement */ - public function toXML(DOMElement $parent = null) : DOMElement + public function toXML(?DOMElement $parent = null) : DOMElement { if ($parent === null) { $doc = DOMDocumentFactory::create(); diff --git a/src/SAML2/XML/md/EntityDescriptor.php b/src/SAML2/XML/md/EntityDescriptor.php index 7ed69997d..903525d06 100644 --- a/src/SAML2/XML/md/EntityDescriptor.php +++ b/src/SAML2/XML/md/EntityDescriptor.php @@ -86,7 +86,7 @@ class EntityDescriptor extends SignedElementHelper * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct($xml); @@ -211,7 +211,7 @@ public function getID() : ?string * @param string|null $Id * @return void */ - public function setID(string $Id = null) : void + public function setID(?string $Id = null) : void { $this->ID = $Id; } @@ -232,7 +232,7 @@ public function getValidUntil() : ?int * @param int|null $validUntil * @return void */ - public function setValidUntil(int $validUntil = null) : void + public function setValidUntil(?int $validUntil = null) : void { $this->validUntil = $validUntil; } @@ -253,7 +253,7 @@ public function getCacheDuration() : ?string * @param string|null $cacheDuration * @return void */ - public function setCacheDuration(string $cacheDuration = null) : void + public function setCacheDuration(?string $cacheDuration = null) : void { $this->cacheDuration = $cacheDuration; } @@ -346,7 +346,7 @@ public function getAffiliationDescriptor() : ?AffiliationDescriptor * @param \SAML2\XML\md\AffiliationDescriptor|null $affiliationDescriptor * @return void */ - public function setAffiliationDescriptor(AffiliationDescriptor $affiliationDescriptor = null) : void + public function setAffiliationDescriptor(?AffiliationDescriptor $affiliationDescriptor = null) : void { $this->AffiliationDescriptor = $affiliationDescriptor; } @@ -369,7 +369,7 @@ public function getOrganization() : ?Organization * @param \SAML2\XML\md\Organization|null $organization * @return void */ - public function setOrganization(Organization $organization = null) : void + public function setOrganization(?Organization $organization = null) : void { $this->Organization = $organization; } @@ -451,7 +451,7 @@ public function addAdditionalMetadataLocation(AdditionalMetadataLocation $additi * @param \DOMElement|null $parent The EntitiesDescriptor we should append this EntityDescriptor to. * @return \DOMElement */ - public function toXML(DOMElement $parent = null) : DOMElement + public function toXML(?DOMElement $parent = null) : DOMElement { if (empty($this->entityID)) { throw new \Exception('Cannot convert EntityDescriptor to XML without an EntityID set.'); diff --git a/src/SAML2/XML/md/IDPSSODescriptor.php b/src/SAML2/XML/md/IDPSSODescriptor.php index c8690eddb..bbfbdb1b6 100644 --- a/src/SAML2/XML/md/IDPSSODescriptor.php +++ b/src/SAML2/XML/md/IDPSSODescriptor.php @@ -75,7 +75,7 @@ class IDPSSODescriptor extends SSODescriptorType * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('md:IDPSSODescriptor', $xml); @@ -126,7 +126,7 @@ public function wantAuthnRequestsSigned() : ?bool * @param bool|null $flag * @return void */ - public function setWantAuthnRequestsSigned(bool $flag = null) : void + public function setWantAuthnRequestsSigned(?bool $flag = null) : void { $this->WantAuthnRequestsSigned = $flag; } diff --git a/src/SAML2/XML/md/IndexedEndpointType.php b/src/SAML2/XML/md/IndexedEndpointType.php index c874b58eb..162c137a2 100644 --- a/src/SAML2/XML/md/IndexedEndpointType.php +++ b/src/SAML2/XML/md/IndexedEndpointType.php @@ -36,7 +36,7 @@ class IndexedEndpointType extends EndpointType * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct($xml); @@ -93,7 +93,7 @@ public function getIsDefault() : ?bool * @param bool|null $flag * @return void */ - public function setIsDefault(bool $flag = null) : void + public function setIsDefault(?bool $flag = null) : void { $this->isDefault = $flag; } diff --git a/src/SAML2/XML/md/KeyDescriptor.php b/src/SAML2/XML/md/KeyDescriptor.php index 8463a1bbf..e995a85bc 100644 --- a/src/SAML2/XML/md/KeyDescriptor.php +++ b/src/SAML2/XML/md/KeyDescriptor.php @@ -51,7 +51,7 @@ class KeyDescriptor * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -94,7 +94,7 @@ public function getUse() : ?string * @param string|null $use * @return void */ - public function setUse(string $use = null) : void + public function setUse(?string $use = null) : void { $this->use = $use; } diff --git a/src/SAML2/XML/md/Organization.php b/src/SAML2/XML/md/Organization.php index 38543a9f5..b2d0ceba5 100644 --- a/src/SAML2/XML/md/Organization.php +++ b/src/SAML2/XML/md/Organization.php @@ -54,7 +54,7 @@ class Organization * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/md/PDPDescriptor.php b/src/SAML2/XML/md/PDPDescriptor.php index eb3dfb221..c2434d304 100644 --- a/src/SAML2/XML/md/PDPDescriptor.php +++ b/src/SAML2/XML/md/PDPDescriptor.php @@ -51,7 +51,7 @@ class PDPDescriptor extends RoleDescriptor * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('md:PDPDescriptor', $xml); diff --git a/src/SAML2/XML/md/RequestedAttribute.php b/src/SAML2/XML/md/RequestedAttribute.php index 816804434..87e174d1c 100644 --- a/src/SAML2/XML/md/RequestedAttribute.php +++ b/src/SAML2/XML/md/RequestedAttribute.php @@ -30,7 +30,7 @@ class RequestedAttribute extends Attribute * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct($xml); @@ -59,7 +59,7 @@ public function getIsRequired() : ?bool * @param bool|null $flag * @return void */ - public function setIsRequired(bool $flag = null) : void + public function setIsRequired(?bool $flag = null) : void { $this->isRequired = $flag; } diff --git a/src/SAML2/XML/md/RoleDescriptor.php b/src/SAML2/XML/md/RoleDescriptor.php index 5457e19ad..a9f3f257c 100644 --- a/src/SAML2/XML/md/RoleDescriptor.php +++ b/src/SAML2/XML/md/RoleDescriptor.php @@ -88,7 +88,7 @@ class RoleDescriptor extends SignedElementHelper * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - protected function __construct(string $elementName, DOMElement $xml = null) + protected function __construct(string $elementName, ?DOMElement $xml = null) { parent::__construct($xml); $this->elementName = $elementName; @@ -155,7 +155,7 @@ public function getID() : ?string * @param string|null $Id * @return void */ - public function setID(string $Id = null) : void + public function setID(?string $Id = null) : void { $this->ID = $Id; } @@ -176,7 +176,7 @@ public function getValidUntil() : ?int * @param int|null $validUntil * @return void */ - public function setValidUntil(int $validUntil = null) : void + public function setValidUntil(?int $validUntil = null) : void { $this->validUntil = $validUntil; } @@ -197,7 +197,7 @@ public function getCacheDuration() : ?string * @param string|null $cacheDuration * @return void */ - public function setCacheDuration(string $cacheDuration = null) : void + public function setCacheDuration(?string $cacheDuration = null) : void { $this->cacheDuration = $cacheDuration; } @@ -244,7 +244,7 @@ public function addExtension(Extensions $extension) : void * @param string|null $errorURL * @return void */ - public function setErrorURL(string $errorURL = null) : void + public function setErrorURL(?string $errorURL = null) : void { if (!is_null($errorURL) && !filter_var($errorURL, FILTER_VALIDATE_URL)) { throw new \InvalidArgumentException('RoleDescriptor errorURL is not a valid URL.'); @@ -316,7 +316,7 @@ public function getOrganization() : ?Organization * @param \SAML2\XML\md\Organization|null $organization * @return void */ - public function setOrganization(Organization $organization = null) : void + public function setOrganization(?Organization $organization = null) : void { $this->Organization = $organization; } diff --git a/src/SAML2/XML/md/SPSSODescriptor.php b/src/SAML2/XML/md/SPSSODescriptor.php index 4d27270ef..58d52673c 100644 --- a/src/SAML2/XML/md/SPSSODescriptor.php +++ b/src/SAML2/XML/md/SPSSODescriptor.php @@ -53,7 +53,7 @@ class SPSSODescriptor extends SSODescriptorType * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { parent::__construct('md:SPSSODescriptor', $xml); @@ -93,7 +93,7 @@ public function getAuthnRequestsSigned() : ?bool * @param bool|null $flag * @return void */ - public function setAuthnRequestsSigned(bool $flag = null) : void + public function setAuthnRequestsSigned(?bool $flag = null) : void { $this->AuthnRequestsSigned = $flag; } @@ -116,7 +116,7 @@ public function wantAssertionsSigned() : ?bool * @param bool|null $flag * @return void */ - public function setWantAssertionsSigned(bool $flag = null) : void + public function setWantAssertionsSigned(?bool $flag = null) : void { $this->WantAssertionsSigned = $flag; } diff --git a/src/SAML2/XML/md/SSODescriptorType.php b/src/SAML2/XML/md/SSODescriptorType.php index ff179b1a7..c4ec15e33 100644 --- a/src/SAML2/XML/md/SSODescriptorType.php +++ b/src/SAML2/XML/md/SSODescriptorType.php @@ -59,7 +59,7 @@ abstract class SSODescriptorType extends RoleDescriptor * @param string $elementName The name of this element. * @param \DOMElement|null $xml The XML element we should load. */ - protected function __construct(string $elementName, DOMElement $xml = null) + protected function __construct(string $elementName, ?DOMElement $xml = null) { parent::__construct($elementName, $xml); diff --git a/src/SAML2/XML/mdattr/EntityAttributes.php b/src/SAML2/XML/mdattr/EntityAttributes.php index 2131170f3..e2ea9fdd0 100644 --- a/src/SAML2/XML/mdattr/EntityAttributes.php +++ b/src/SAML2/XML/mdattr/EntityAttributes.php @@ -39,7 +39,7 @@ class EntityAttributes * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/mdrpi/PublicationInfo.php b/src/SAML2/XML/mdrpi/PublicationInfo.php index b8e87cb2e..7d0e02d80 100644 --- a/src/SAML2/XML/mdrpi/PublicationInfo.php +++ b/src/SAML2/XML/mdrpi/PublicationInfo.php @@ -54,7 +54,7 @@ class PublicationInfo * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -139,7 +139,7 @@ public function setPublisher(string $publisher) : void * @param int|null $creationInstant * @return void */ - public function setCreationInstant(int $creationInstant = null) : void + public function setCreationInstant(?int $creationInstant = null) : void { $this->creationInstant = $creationInstant; } @@ -151,7 +151,7 @@ public function setCreationInstant(int $creationInstant = null) : void * @param string|null $publicationId * @return void */ - public function setPublicationId(string $publicationId = null) : void + public function setPublicationId(?string $publicationId = null) : void { $this->publicationId = $publicationId; } diff --git a/src/SAML2/XML/mdrpi/RegistrationInfo.php b/src/SAML2/XML/mdrpi/RegistrationInfo.php index ea2ee751c..a5c7216af 100644 --- a/src/SAML2/XML/mdrpi/RegistrationInfo.php +++ b/src/SAML2/XML/mdrpi/RegistrationInfo.php @@ -46,7 +46,7 @@ class RegistrationInfo * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -107,7 +107,7 @@ public function getRegistrationInstant() : ?int * @param int|null $registrationInstant * @return void */ - public function setRegistrationInstant(int $registrationInstant = null) : void + public function setRegistrationInstant(?int $registrationInstant = null) : void { $this->registrationInstant = $registrationInstant; } diff --git a/src/SAML2/XML/mdui/DiscoHints.php b/src/SAML2/XML/mdui/DiscoHints.php index 728fb53c1..c70aac52f 100644 --- a/src/SAML2/XML/mdui/DiscoHints.php +++ b/src/SAML2/XML/mdui/DiscoHints.php @@ -53,7 +53,7 @@ class DiscoHints * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/mdui/Keywords.php b/src/SAML2/XML/mdui/Keywords.php index c79c9e598..64740a958 100644 --- a/src/SAML2/XML/mdui/Keywords.php +++ b/src/SAML2/XML/mdui/Keywords.php @@ -38,7 +38,7 @@ class Keywords * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/mdui/Logo.php b/src/SAML2/XML/mdui/Logo.php index b680a759b..41dcd66d3 100644 --- a/src/SAML2/XML/mdui/Logo.php +++ b/src/SAML2/XML/mdui/Logo.php @@ -49,7 +49,7 @@ class Logo * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/mdui/UIInfo.php b/src/SAML2/XML/mdui/UIInfo.php index 4871c95b6..fa147b64d 100644 --- a/src/SAML2/XML/mdui/UIInfo.php +++ b/src/SAML2/XML/mdui/UIInfo.php @@ -74,7 +74,7 @@ class UIInfo * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/saml/Attribute.php b/src/SAML2/XML/saml/Attribute.php index ec86fab77..a006cf13f 100644 --- a/src/SAML2/XML/saml/Attribute.php +++ b/src/SAML2/XML/saml/Attribute.php @@ -53,7 +53,7 @@ class Attribute * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -118,7 +118,7 @@ public function getNameFormat() : ?string * @param string|null $nameFormat * @return void */ - public function setNameFormat(string $nameFormat = null) : void + public function setNameFormat(?string $nameFormat = null) : void { $this->NameFormat = $nameFormat; } @@ -141,7 +141,7 @@ public function getFriendlyName() : ?string * @param string|null $friendlyName * @return void */ - public function setFriendlyName(string $friendlyName = null) : void + public function setFriendlyName(?string $friendlyName = null) : void { $this->FriendlyName = $friendlyName; } diff --git a/src/SAML2/XML/saml/BaseIDType.php b/src/SAML2/XML/saml/BaseIDType.php index aa54e2793..b95f4a4eb 100644 --- a/src/SAML2/XML/saml/BaseIDType.php +++ b/src/SAML2/XML/saml/BaseIDType.php @@ -35,7 +35,7 @@ abstract class BaseIDType * * @param \DOMElement|null $xml The XML element we should load, if any. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -57,7 +57,7 @@ public function __construct(DOMElement $xml = null) * @param \DOMElement $parent The element we are converting to XML. * @return \DOMElement The XML element after adding the data corresponding to this BaseID. */ - public function toXML(DOMElement $parent = null) : DOMElement + public function toXML(?DOMElement $parent = null) : DOMElement { if ($parent === null) { $parent = DOMDocumentFactory::create(); diff --git a/src/SAML2/XML/saml/IDNameQualifiersTrait.php b/src/SAML2/XML/saml/IDNameQualifiersTrait.php index d3ac25e67..857b38549 100644 --- a/src/SAML2/XML/saml/IDNameQualifiersTrait.php +++ b/src/SAML2/XML/saml/IDNameQualifiersTrait.php @@ -50,7 +50,7 @@ public function getNameQualifier(): ?string * @param string|null $nameQualifier * @return void */ - public function setNameQualifier(string $nameQualifier = null) : void + public function setNameQualifier(?string $nameQualifier = null) : void { $this->NameQualifier = $nameQualifier; } @@ -73,7 +73,7 @@ public function getSPNameQualifier(): ?string * @param string|null $spNameQualifier * @return void */ - public function setSPNameQualifier(string $spNameQualifier = null) : void + public function setSPNameQualifier(?string $spNameQualifier = null) : void { $this->SPNameQualifier = $spNameQualifier; } diff --git a/src/SAML2/XML/saml/Issuer.php b/src/SAML2/XML/saml/Issuer.php index f37f11611..a17c7b5de 100644 --- a/src/SAML2/XML/saml/Issuer.php +++ b/src/SAML2/XML/saml/Issuer.php @@ -42,7 +42,7 @@ class Issuer extends NameIDType * * @param \DOMElement|null $xml The XML element we should load, if any. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { /** * The format of this NameIDType. @@ -99,7 +99,7 @@ public function setSaml2IssuerShowAll(bool $saml2IssuerShowAll) : void * @param \DOMElement|null $parent The element we should append to. * @return \DOMElement The current Issuer object converted into a \DOMElement. */ - public function toXML(DOMElement $parent = null) : DOMElement + public function toXML(?DOMElement $parent = null) : DOMElement { if (($this->Saml2IssuerShowAll && ($this->Format === Constants::NAMEID_ENTITY)) || ($this->Format !== Constants::NAMEID_ENTITY) diff --git a/src/SAML2/XML/saml/NameIDType.php b/src/SAML2/XML/saml/NameIDType.php index 602d43b65..5f3413f3d 100644 --- a/src/SAML2/XML/saml/NameIDType.php +++ b/src/SAML2/XML/saml/NameIDType.php @@ -63,7 +63,7 @@ abstract class NameIDType implements Serializable * * @param \DOMElement|null $xml The XML element we should load, if any. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -106,7 +106,7 @@ public function getFormat() : ?string * @param string|null $format * @return void */ - public function setFormat(string $format = null) : void + public function setFormat(?string $format = null) : void { $this->Format = $format; } @@ -152,7 +152,7 @@ public function getSPProvidedID() : ?string * @param string|null $spProvidedID * @return void */ - public function setSPProvidedID(string $spProvidedID = null) : void + public function setSPProvidedID(?string $spProvidedID = null) : void { $this->SPProvidedID = $spProvidedID; } @@ -164,7 +164,7 @@ public function setSPProvidedID(string $spProvidedID = null) : void * @param \DOMElement $parent The element we are converting to XML. * @return \DOMElement The XML element after adding the data corresponding to this NameIDType. */ - public function toXML(DOMElement $parent = null) : DOMElement + public function toXML(?DOMElement $parent = null) : DOMElement { if ($parent === null) { $parent = DOMDocumentFactory::create(); diff --git a/src/SAML2/XML/saml/SubjectConfirmation.php b/src/SAML2/XML/saml/SubjectConfirmation.php index f933ece1e..acd943e32 100644 --- a/src/SAML2/XML/saml/SubjectConfirmation.php +++ b/src/SAML2/XML/saml/SubjectConfirmation.php @@ -45,7 +45,7 @@ class SubjectConfirmation * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; @@ -114,7 +114,7 @@ public function getNameID() : ?NameID * @param \SAML2\XML\saml\NameID $nameId * @return void */ - public function setNameID(NameID $nameId = null) : void + public function setNameID(?NameID $nameId = null) : void { $this->NameID = $nameId; } @@ -137,7 +137,7 @@ public function getSubjectConfirmationData() : ?SubjectConfirmationData * @param \SAML2\XML\saml\SubjectConfirmationData|null $subjectConfirmationData * @return void */ - public function setSubjectConfirmationData(SubjectConfirmationData $subjectConfirmationData = null) : void + public function setSubjectConfirmationData(?SubjectConfirmationData $subjectConfirmationData = null) : void { $this->SubjectConfirmationData = $subjectConfirmationData; } diff --git a/src/SAML2/XML/saml/SubjectConfirmationData.php b/src/SAML2/XML/saml/SubjectConfirmationData.php index a37dc9c4c..37a036a39 100644 --- a/src/SAML2/XML/saml/SubjectConfirmationData.php +++ b/src/SAML2/XML/saml/SubjectConfirmationData.php @@ -83,7 +83,7 @@ public function getNotBefore() : ?int * @param int|null $notBefore * @return void */ - public function setNotBefore(int $notBefore = null) : void + public function setNotBefore(?int $notBefore = null) : void { $this->NotBefore = $notBefore; } @@ -106,7 +106,7 @@ public function getNotOnOrAfter() : ?int * @param int|null $notOnOrAfter * @return void */ - public function setNotOnOrAfter(int $notOnOrAfter = null) : void + public function setNotOnOrAfter(?int $notOnOrAfter = null) : void { $this->NotOnOrAfter = $notOnOrAfter; } @@ -129,7 +129,7 @@ public function getRecipient() : ?string * @param string|null $recipient * @return void */ - public function setRecipient(string $recipient = null) : void + public function setRecipient(?string $recipient = null) : void { $this->Recipient = $recipient; } @@ -152,7 +152,7 @@ public function getInResponseTo() : ?string * @param string|null $inResponseTo * @return void */ - public function setInResponseTo(string $inResponseTo = null) : void + public function setInResponseTo(?string $inResponseTo = null) : void { $this->InResponseTo = $inResponseTo; } @@ -175,7 +175,7 @@ public function getAddress() : ?string * @param string|null $address * @return void */ - public function setAddress(string $address = null) : void + public function setAddress(?string $address = null) : void { if (!is_null($address) && !filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { Utils::getContainer()->getLogger()->warning(sprintf('Provided argument (%s) is not a valid IP address.', $address)); @@ -225,7 +225,7 @@ public function addInfo($info) : void * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return; diff --git a/src/SAML2/XML/shibmd/Scope.php b/src/SAML2/XML/shibmd/Scope.php index b1dab87d5..67a5e3f43 100644 --- a/src/SAML2/XML/shibmd/Scope.php +++ b/src/SAML2/XML/shibmd/Scope.php @@ -42,7 +42,7 @@ class Scope * * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(?DOMElement $xml = null) { if ($xml === null) { return;