From edbaaee9af7e4d41d8369f1e9d8b2af73edd1993 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 28 Jan 2024 19:12:12 +0100 Subject: [PATCH] Fix PHPStan issues --- phpstan-dev.neon | 2 +- src/XML/auth/AbstractStructuredValueType.php | 4 ++-- src/XML/auth/AbstractValueInRangeType.php | 2 +- .../fed/AbstractApplicationServiceType.php | 1 + src/XML/fed/AbstractAssertionType.php | 4 ++-- src/XML/fed/AbstractClaimDialectType.php | 4 ++-- .../fed/AbstractClaimDialectsOfferedType.php | 6 +++--- src/XML/fed/AbstractEndpointType.php | 4 ++-- src/XML/fed/AbstractFilterPseudonymsType.php | 4 ++-- src/XML/fed/AbstractFreshnessType.php | 2 +- src/XML/fed/AbstractIssuerNameType.php | 2 +- ...AbstractLogicalServiceNamesOfferedType.php | 6 +++--- src/XML/fed/AbstractProofTokenType.php | 2 +- src/XML/fed/AbstractPseudonymType.php | 12 ++++++------ src/XML/fed/AbstractReferenceTokenType.php | 8 ++++---- src/XML/fed/AbstractRequestProofTokenType.php | 4 ++-- src/XML/fed/AbstractRequestPseudonymType.php | 4 ++-- src/XML/fed/AbstractSecurityTokenType.php | 2 +- src/XML/fed/AbstractSignOutBasisType.php | 4 ++-- src/XML/fed/AbstractSignOutType.php | 4 ++-- src/XML/fed/AbstractTokenType.php | 4 ++-- src/XML/fed/AbstractTokenTypesOfferedType.php | 8 ++++---- .../fed/AbstractWebServiceDescriptorType.php | 4 ---- src/XML/sp/AbstractIssuedTokenType.php | 4 ++-- src/XML/sp/AbstractKeyValueTokenType.php | 4 ++-- src/XML/sp/AbstractReqPartsType.php | 2 +- ...stractRequestSecurityTokenTemplateType.php | 4 ++-- src/XML/sp/AbstractSePartsType.php | 2 +- .../AbstractSecureConversationTokenType.php | 6 +++--- src/XML/sp/AbstractSerElementsType.php | 4 ++-- src/XML/sp/AbstractSpnegoContextTokenType.php | 6 +++--- src/XML/sp/AbstractTokenAssertionType.php | 6 +++--- src/XML/wsp/AbstractOperatorContentType.php | 19 +++++++++++-------- src/XML/wsp/AppliesTo.php | 4 ++-- src/XML/wsp/Policy.php | 1 + src/XML/wsp/PolicyAttachment.php | 4 ++-- src/XML/wsse/AbstractAttributedString.php | 4 +++- .../wsse/AbstractBinarySecurityTokenType.php | 2 +- src/XML/wsse/AbstractEmbeddedType.php | 4 ++-- src/XML/wsse/AbstractEncodedString.php | 4 +++- src/XML/wsse/AbstractKeyIdentifierType.php | 2 +- src/XML/wsse/AbstractPasswordString.php | 2 +- src/XML/wsse/AbstractReferenceType.php | 2 +- src/XML/wsse/AbstractSecurityHeaderType.php | 4 ++-- .../AbstractSecurityTokenReferenceType.php | 4 ++-- .../AbstractTransformationParametersType.php | 4 ++-- src/XML/wst/AbstractAuthenticatorType.php | 2 +- src/XML/wst/AbstractBinaryExchangeType.php | 2 +- src/XML/wst/AbstractBinarySecretType.php | 2 +- src/XML/wst/AbstractClaimsType.php | 4 ++-- src/XML/wst/AbstractComputedKeyOpenEnum.php | 2 ++ src/XML/wst/AbstractEntropyType.php | 4 ++-- src/XML/wst/AbstractKeyExchangeTokenType.php | 2 +- src/XML/wst/AbstractKeyTypeOpenEnum.php | 2 ++ src/XML/wst/AbstractParticipantsType.php | 4 ++-- ...ractRequestSecurityTokenCollectionType.php | 2 +- ...estSecurityTokenResponseCollectionType.php | 4 ++-- ...stractRequestSecurityTokenResponseType.php | 4 ++-- .../wst/AbstractRequestSecurityTokenType.php | 6 ++++-- src/XML/wst/AbstractRequestTypeOpenEnum.php | 2 ++ src/XML/wst/AbstractSignChallengeType.php | 4 ++-- src/XML/wst/AbstractStatusCodeOpenEnum.php | 2 ++ src/XML/wsu/AbstractAttributedDateTime.php | 2 +- src/XML/wsu/AbstractAttributedURI.php | 2 +- src/XML/wsu/AbstractTimestamp.php | 7 +++---- .../XML/auth/ConstrainedValueTest.php | 4 +++- tests/WSSecurity/XML/wsp/AppliesToTest.php | 3 --- 67 files changed, 137 insertions(+), 124 deletions(-) diff --git a/phpstan-dev.neon b/phpstan-dev.neon index 4d29b8b5..508f5d02 100644 --- a/phpstan-dev.neon +++ b/phpstan-dev.neon @@ -1,4 +1,4 @@ parameters: - level: 9 + level: 4 paths: - tests diff --git a/src/XML/auth/AbstractStructuredValueType.php b/src/XML/auth/AbstractStructuredValueType.php index f6b72355..4eed2074 100644 --- a/src/XML/auth/AbstractStructuredValueType.php +++ b/src/XML/auth/AbstractStructuredValueType.php @@ -32,8 +32,8 @@ abstract class AbstractStructuredValueType extends AbstractAuthElement /** * AbstractStructuredValueType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/auth/AbstractValueInRangeType.php b/src/XML/auth/AbstractValueInRangeType.php index fb1b2706..cad36bf2 100644 --- a/src/XML/auth/AbstractValueInRangeType.php +++ b/src/XML/auth/AbstractValueInRangeType.php @@ -23,7 +23,7 @@ abstract class AbstractValueInRangeType extends AbstractAuthElement * @param \SimpleSAML\WSSecurity\XML\auth\ValueUpperBound $valueUpperBound * @param \SimpleSAML\WSSecurity\XML\auth\ValueLowerBound $valueLowerBound */ - public function __construct( + final public function __construct( protected ValueUpperBound $valueUpperBound, protected ValueLowerBound $valueLowerBound ) { diff --git a/src/XML/fed/AbstractApplicationServiceType.php b/src/XML/fed/AbstractApplicationServiceType.php index a06cd1c9..d80c141e 100644 --- a/src/XML/fed/AbstractApplicationServiceType.php +++ b/src/XML/fed/AbstractApplicationServiceType.php @@ -46,6 +46,7 @@ abstract class AbstractApplicationServiceType extends AbstractWebServiceDescript * @param string|null $serviceDescription * @param \SimpleSAML\WSSecurity\XML\fed\ApplicationServiceEndpoint[] $applicationServiceEndpoint * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint + * @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint */ final public function __construct( array $protocolSupportEnumeration, diff --git a/src/XML/fed/AbstractAssertionType.php b/src/XML/fed/AbstractAssertionType.php index eb8163f7..ff07c8b1 100644 --- a/src/XML/fed/AbstractAssertionType.php +++ b/src/XML/fed/AbstractAssertionType.php @@ -32,8 +32,8 @@ abstract class AbstractAssertionType extends AbstractFedElement /** * AbstractAssertionType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/fed/AbstractClaimDialectType.php b/src/XML/fed/AbstractClaimDialectType.php index ba6cd388..38b324ab 100644 --- a/src/XML/fed/AbstractClaimDialectType.php +++ b/src/XML/fed/AbstractClaimDialectType.php @@ -34,8 +34,8 @@ abstract class AbstractClaimDialectType extends AbstractFedElement * AbstractClaimDialectType constructor * * @param string|null $Uri - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $Uri = null, diff --git a/src/XML/fed/AbstractClaimDialectsOfferedType.php b/src/XML/fed/AbstractClaimDialectsOfferedType.php index 82f23178..a67ed98e 100644 --- a/src/XML/fed/AbstractClaimDialectsOfferedType.php +++ b/src/XML/fed/AbstractClaimDialectsOfferedType.php @@ -29,8 +29,8 @@ abstract class AbstractClaimDialectsOfferedType extends AbstractFedElement /** * AbstractClaimDialectsOfferedType constructor * - * @param \SimpleSAML\WSSecurity\XML\fed\ClaimDialect[] $claimDialect - * @param array $namespacedAttributes + * @param array<\SimpleSAML\WSSecurity\XML\fed\ClaimDialect> $claimDialect + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $claimDialect, @@ -44,7 +44,7 @@ final public function __construct( /** - * @return array + * @return array<\SimpleSAML\WSSecurity\XML\fed\ClaimDialect> */ public function getClaimDialect(): array { diff --git a/src/XML/fed/AbstractEndpointType.php b/src/XML/fed/AbstractEndpointType.php index b2db555d..16bf0df8 100644 --- a/src/XML/fed/AbstractEndpointType.php +++ b/src/XML/fed/AbstractEndpointType.php @@ -20,7 +20,7 @@ abstract class AbstractEndpointType extends AbstractFedElement /** * ReferenceType constructor. * - * @param \SimpleSAML\WSSecurity\XML\wsa\EndpointReference[] $endpointReference + * @param array<\SimpleSAML\WSSecurity\XML\wsa\EndpointReference> $endpointReference */ final public function __construct( protected array $endpointReference, @@ -31,7 +31,7 @@ final public function __construct( /** - * @return array + * @return array<\SimpleSAML\WSSecurity\XML\wsa\EndpointReference> */ public function getEndpointReference(): array { diff --git a/src/XML/fed/AbstractFilterPseudonymsType.php b/src/XML/fed/AbstractFilterPseudonymsType.php index bfc80854..95c89255 100644 --- a/src/XML/fed/AbstractFilterPseudonymsType.php +++ b/src/XML/fed/AbstractFilterPseudonymsType.php @@ -35,8 +35,8 @@ abstract class AbstractFilterPseudonymsType extends AbstractFedElement * * @param \SimpleSAML\WSSecurity\XML\fed\PseudonymBasis|null $pseudonymBasis * @param \SimpleSAML\WSSecurity\XML\fed\RelativeTo|null $relativeTo - * @param \SimpleSAML\XML\SerializableElementInterface[] $childeren - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?PseudonymBasis $pseudonymBasis = null, diff --git a/src/XML/fed/AbstractFreshnessType.php b/src/XML/fed/AbstractFreshnessType.php index c7f653e5..cd84f5dc 100644 --- a/src/XML/fed/AbstractFreshnessType.php +++ b/src/XML/fed/AbstractFreshnessType.php @@ -35,7 +35,7 @@ abstract class AbstractFreshnessType extends AbstractFedElement * * @param int $content * @param bool|null $AllowCache - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( int $content, diff --git a/src/XML/fed/AbstractIssuerNameType.php b/src/XML/fed/AbstractIssuerNameType.php index 8ef66d9c..9cf28aa9 100644 --- a/src/XML/fed/AbstractIssuerNameType.php +++ b/src/XML/fed/AbstractIssuerNameType.php @@ -28,7 +28,7 @@ abstract class AbstractIssuerNameType extends AbstractFedElement * AbstractIssuerNameType constructor * * @param string $Uri - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected string $Uri, diff --git a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php index 3db3070b..e7407b4d 100644 --- a/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php +++ b/src/XML/fed/AbstractLogicalServiceNamesOfferedType.php @@ -29,8 +29,8 @@ abstract class AbstractLogicalServiceNamesOfferedType extends AbstractFedElement /** * LogicalServiceNamesOfferedType constructor * - * @param \SimpleSAML\WSSecurity\XML\fed\IssuerName[] $issuerName - * @param array $namespacedAttributes + * @param array<\SimpleSAML\WSSecurity\XML\fed\IssuerName> $issuerName + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $issuerName, @@ -44,7 +44,7 @@ final public function __construct( /** - * @return array + * @return array<\SimpleSAML\WSSecurity\XML\fed\IssuerName> */ public function getIssuerName(): array { diff --git a/src/XML/fed/AbstractProofTokenType.php b/src/XML/fed/AbstractProofTokenType.php index 8fe2f19c..a19c32f7 100644 --- a/src/XML/fed/AbstractProofTokenType.php +++ b/src/XML/fed/AbstractProofTokenType.php @@ -35,7 +35,7 @@ abstract class AbstractProofTokenType extends AbstractFedElement * AbstractProofTokenType constructor * * @param \SimpleSAML\XML\SerializableElementInterface $child - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected SerializableElementinterface $child, diff --git a/src/XML/fed/AbstractPseudonymType.php b/src/XML/fed/AbstractPseudonymType.php index 54de6813..1c0cd503 100644 --- a/src/XML/fed/AbstractPseudonymType.php +++ b/src/XML/fed/AbstractPseudonymType.php @@ -39,10 +39,10 @@ abstract class AbstractPseudonymType extends AbstractFedElement * @param \SimpleSAML\WSSecurity\XML\fed\PseudonymBasis $pseudonymBasis * @param \SimpleSAML\WSSecurity\XML\fed\RelativeTo $relativeTo * @param \SimpleSAML\WSSecurity\XML\wsu\Expires|null $expires - * @param \SimpleSAML\WSSecurity\XML\fed\SecurityToken[] $securityToken - * @param \SimpleSAML\WSSecurity\XML\fed\ProofToken[] $proofToken - * @param \SimpleSAML\XML\SerializableElementInterface[] $childeren - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\WSSecurity\XML\fed\SecurityToken> $securityToken + * @param array<\SimpleSAML\WSSecurity\XML\fed\ProofToken> $proofToken + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected PseudonymBasis $pseudonymBasis, @@ -107,7 +107,7 @@ public function getExpires(): ?Expires /** * Collect the value of the securityToken-property * - * @return \SimpleSAML\WSSecurity\XML\fed\SecurityToken[] + * @return array<\SimpleSAML\WSSecurity\XML\fed\SecurityToken> */ public function getSecurityToken(): array { @@ -118,7 +118,7 @@ public function getSecurityToken(): array /** * Collect the value of the proofToken-property * - * @return \SimpleSAML\WSSecurity\XML\fed\ProofToken[] + * @return array<\SimpleSAML\WSSecurity\XML\fed\ProofToken> */ public function getProofToken(): array { diff --git a/src/XML/fed/AbstractReferenceTokenType.php b/src/XML/fed/AbstractReferenceTokenType.php index 95b34c4b..8ca26c93 100644 --- a/src/XML/fed/AbstractReferenceTokenType.php +++ b/src/XML/fed/AbstractReferenceTokenType.php @@ -34,12 +34,12 @@ abstract class AbstractReferenceTokenType extends AbstractFedElement /** * ReferenceTokenType constructor. * - * @param \SimpleSAML\WSSecurity\XML\fed\ReferenceEPR[] $referenceEPR + * @param array<\SimpleSAML\WSSecurity\XML\fed\ReferenceEPR> $referenceEPR * @param \SimpleSAML\WSSecurity\XML\fed\ReferenceDigest|null $referenceDigest * @param \SimpleSAML\WSSecurity\XML\fed\ReferenceType|null $referenceType * @param \SimpleSAML\WSSecurity\XML\fed\SerialNo|null $serialNo - * @param \SimpleSAML\XML\ElementInterface[] $children - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $referenceEPR = [], @@ -64,7 +64,7 @@ final public function __construct( /** * Collect the value of the referenceEPR-property * - * @return \SimpleSAML\WSSecurity\XML\fed\ReferenceEPR[] + * @return array<\SimpleSAML\WSSecurity\XML\fed\ReferenceEPR> */ public function getReferenceEPR(): array { diff --git a/src/XML/fed/AbstractRequestProofTokenType.php b/src/XML/fed/AbstractRequestProofTokenType.php index ae7dd32f..a980ba00 100644 --- a/src/XML/fed/AbstractRequestProofTokenType.php +++ b/src/XML/fed/AbstractRequestProofTokenType.php @@ -32,8 +32,8 @@ abstract class AbstractRequestProofTokenType extends AbstractFedElement /** * AbstractRequestProofTokenType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/fed/AbstractRequestPseudonymType.php b/src/XML/fed/AbstractRequestPseudonymType.php index 64755b82..8724f318 100644 --- a/src/XML/fed/AbstractRequestPseudonymType.php +++ b/src/XML/fed/AbstractRequestPseudonymType.php @@ -34,8 +34,8 @@ abstract class AbstractRequestPseudonymType extends AbstractFedElement * * @param bool|null $SingleUse * @param bool|null $Lookup - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?bool $SingleUse = null, diff --git a/src/XML/fed/AbstractSecurityTokenType.php b/src/XML/fed/AbstractSecurityTokenType.php index 30684c49..0be4fc99 100644 --- a/src/XML/fed/AbstractSecurityTokenType.php +++ b/src/XML/fed/AbstractSecurityTokenType.php @@ -35,7 +35,7 @@ abstract class AbstractSecurityTokenType extends AbstractFedElement * AbstractSecurityTokenType constructor * * @param \SimpleSAML\XML\SerializableElementInterface $child - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected SerializableElementinterface $child, diff --git a/src/XML/fed/AbstractSignOutBasisType.php b/src/XML/fed/AbstractSignOutBasisType.php index b5911601..fd46872e 100644 --- a/src/XML/fed/AbstractSignOutBasisType.php +++ b/src/XML/fed/AbstractSignOutBasisType.php @@ -33,8 +33,8 @@ abstract class AbstractSignOutBasisType extends AbstractFedElement /** * SignOutBasisType constructor. * - * @param \SimpleSAML\XML\SerializableElementInterface[] $childeren - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/fed/AbstractSignOutType.php b/src/XML/fed/AbstractSignOutType.php index 9b7639f5..8d39cd7a 100644 --- a/src/XML/fed/AbstractSignOutType.php +++ b/src/XML/fed/AbstractSignOutType.php @@ -39,8 +39,8 @@ abstract class AbstractSignOutType extends AbstractFedElement * @param \SimpleSAML\WSSecurity\XML\fed\SignOutBasis $signOutBasis * @param \SimpleSAML\WSSecurity\XML\fed\Realm|null $realm * @param string|null $Id - * @param \SimpleSAML\XML\SerializableElementInterface[] $childeren - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected SignOutBasis $signOutBasis, diff --git a/src/XML/fed/AbstractTokenType.php b/src/XML/fed/AbstractTokenType.php index e7ff0d68..a11e9106 100644 --- a/src/XML/fed/AbstractTokenType.php +++ b/src/XML/fed/AbstractTokenType.php @@ -34,8 +34,8 @@ abstract class AbstractTokenType extends AbstractFedElement * AbstractTokenType constructor * * @param string|null $Uri - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $Uri = null, diff --git a/src/XML/fed/AbstractTokenTypesOfferedType.php b/src/XML/fed/AbstractTokenTypesOfferedType.php index 8934f2ba..03d39689 100644 --- a/src/XML/fed/AbstractTokenTypesOfferedType.php +++ b/src/XML/fed/AbstractTokenTypesOfferedType.php @@ -35,9 +35,9 @@ abstract class AbstractTokenTypesOfferedType extends AbstractFedElement /** * AbstractTokenTypesOffered constructor * - * @param \SimpleSAML\WSSecurity\XML\fed\TokenType[] $tokenType - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\WSSecurity\XML\fed\TokenType> $tokenType + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $tokenType, @@ -53,7 +53,7 @@ final public function __construct( /** - * @return array + * @return array<\SimpleSAML\WSSecurity\XML\fed\TokenType> */ public function getTokenType(): array { diff --git a/src/XML/fed/AbstractWebServiceDescriptorType.php b/src/XML/fed/AbstractWebServiceDescriptorType.php index 073aed06..ca3a9856 100644 --- a/src/XML/fed/AbstractWebServiceDescriptorType.php +++ b/src/XML/fed/AbstractWebServiceDescriptorType.php @@ -49,10 +49,6 @@ abstract class AbstractWebServiceDescriptorType extends AbstractRoleDescriptorTy * @param \SimpleSAML\WSSecurity\XML\fed\TargetScopes|null $targetScopes * @param string|null $serviceDisplayName * @param string|null $serviceDescription - * @param \SimpleSAML\WSSecurity\XML\fed\SecurityTokenServiceEndpoint[] $securityTokenServiceEndpoint - * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutSubscriptionEndpoint[] $singleSignOutSubscriptionEndpoint - * @param \SimpleSAML\WSSecurity\XML\fed\SingleSignOutNotificationEndpoint[] $singleSignOutNotificationEndpoint - * @param \SimpleSAML\WSSecurity\XML\fed\PassiveRequestorEndpoint[] $passiveRequestorEndpoint */ protected function __construct( array $protocolSupportEnumeration, diff --git a/src/XML/sp/AbstractIssuedTokenType.php b/src/XML/sp/AbstractIssuedTokenType.php index 35380839..c12da912 100644 --- a/src/XML/sp/AbstractIssuedTokenType.php +++ b/src/XML/sp/AbstractIssuedTokenType.php @@ -43,7 +43,7 @@ abstract class AbstractIssuedTokenType extends AbstractSpElement * @param \SimpleSAML\WSSecurity\XML\sp\RequestSecurityTokenTemplate $requestSecurityTokenTemplate * @param \SimpleSAML\WSSecurity\XML\sp\Issuer|\SimpleSAML\WSSecurity\XML\sp\IssuerName|null $issuer * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|null $includeToken - * @param list<\SimpleSAML\XML\ElementInterface> $elts + * @param list<\SimpleSAML\XML\SerializableElementInterface> $elts * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( @@ -113,7 +113,7 @@ public static function fromXML(DOMElement $xml): static try { $includeToken = IncludeToken::from(self::getOptionalAttribute($xml, 'IncludeToken', null)); } catch (ValueError) { - self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); } $elements = []; diff --git a/src/XML/sp/AbstractKeyValueTokenType.php b/src/XML/sp/AbstractKeyValueTokenType.php index 5c47876b..23fabed6 100644 --- a/src/XML/sp/AbstractKeyValueTokenType.php +++ b/src/XML/sp/AbstractKeyValueTokenType.php @@ -38,7 +38,7 @@ abstract class AbstractKeyValueTokenType extends AbstractSpElement * KeyValueTokenType constructor. * * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|null $includeToken - * @param list<\SimpleSAML\XML\ElementInterface> $elts + * @param list<\SimpleSAML\XML\SerializableElementInterface> $elts * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( @@ -89,7 +89,7 @@ public static function fromXML(DOMElement $xml): static try { $includeToken = IncludeToken::from(self::getOptionalAttribute($xml, 'IncludeToken', null)); } catch (ValueError) { - self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); } $elements = []; diff --git a/src/XML/sp/AbstractReqPartsType.php b/src/XML/sp/AbstractReqPartsType.php index 5988f378..c4e9b858 100644 --- a/src/XML/sp/AbstractReqPartsType.php +++ b/src/XML/sp/AbstractReqPartsType.php @@ -95,7 +95,7 @@ public static function fromXML(DOMElement $xml): static ); $header = Header::getChildrenOfClass($xml); - Assert::maxcount($header, 1, TooManyElementsException::class); + Assert::maxCount($header, 1, TooManyElementsException::class); $details = []; foreach ($xml->childNodes as $detail) { diff --git a/src/XML/sp/AbstractRequestSecurityTokenTemplateType.php b/src/XML/sp/AbstractRequestSecurityTokenTemplateType.php index 37aa1bf8..cf38ac08 100644 --- a/src/XML/sp/AbstractRequestSecurityTokenTemplateType.php +++ b/src/XML/sp/AbstractRequestSecurityTokenTemplateType.php @@ -35,8 +35,8 @@ abstract class AbstractRequestSecurityTokenTemplateType extends AbstractSpElemen * AbstractRequestSecurityTokenTemplateType constructor. * * @param string|null $trustVersion - * @param list<\SimpleSAML\XML\ElementInterface> $elts - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $trustVersion = null, diff --git a/src/XML/sp/AbstractSePartsType.php b/src/XML/sp/AbstractSePartsType.php index cedadd5e..40e6ba42 100644 --- a/src/XML/sp/AbstractSePartsType.php +++ b/src/XML/sp/AbstractSePartsType.php @@ -126,7 +126,7 @@ public static function fromXML(DOMElement $xml): static $body = Body::getChildrenOfClass($xml); $header = Header::getChildrenOfClass($xml); - Assert::maxcount($header, 1, TooManyElementsException::class); + Assert::maxCount($header, 1, TooManyElementsException::class); $attachments = Attachments::getChildrenOfClass($xml); diff --git a/src/XML/sp/AbstractSecureConversationTokenType.php b/src/XML/sp/AbstractSecureConversationTokenType.php index a9b92e27..bdecc3a3 100644 --- a/src/XML/sp/AbstractSecureConversationTokenType.php +++ b/src/XML/sp/AbstractSecureConversationTokenType.php @@ -40,8 +40,8 @@ abstract class AbstractSecureConversationTokenType extends AbstractSpElement * * @param \SimpleSAML\WSSecurity\XML\sp\Issuer|\SimpleSAML\WSSecurity\XML\sp\IssuerName|null $issuer * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|null $includeToken - * @param list<\SimpleSAML\XML\ElementInterface> $elts - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected Issuer|IssuerName|null $issuer, @@ -108,7 +108,7 @@ public static function fromXML(DOMElement $xml): static try { $includeToken = IncludeToken::from(self::getOptionalAttribute($xml, 'IncludeToken', null)); } catch (ValueError) { - self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); } $elements = []; diff --git a/src/XML/sp/AbstractSerElementsType.php b/src/XML/sp/AbstractSerElementsType.php index 7ced6462..07c2695e 100644 --- a/src/XML/sp/AbstractSerElementsType.php +++ b/src/XML/sp/AbstractSerElementsType.php @@ -37,8 +37,8 @@ abstract class AbstractSerElementsType extends AbstractSpElement * * @param list<\SimpleSAML\WSSecurity\XML\sp\XPath> $xpath * @param string|null $xpathVersion - * @param list<\SimpleSAML\XML\ElementInterface> $elts - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $xpath, diff --git a/src/XML/sp/AbstractSpnegoContextTokenType.php b/src/XML/sp/AbstractSpnegoContextTokenType.php index 130a9448..3af25de3 100644 --- a/src/XML/sp/AbstractSpnegoContextTokenType.php +++ b/src/XML/sp/AbstractSpnegoContextTokenType.php @@ -40,8 +40,8 @@ abstract class AbstractSpnegoContextTokenType extends AbstractSpElement * * @param \SimpleSAML\WSSecurity\XML\sp\Issuer|\SimpleSAML\WSSecurity\XML\sp\IssuerName|null $issuer * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|null $includeToken - * @param list<\SimpleSAML\XML\ElementInterface> $elts - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected Issuer|IssuerName|null $issuer, @@ -108,7 +108,7 @@ public static function fromXML(DOMElement $xml): static try { $includeToken = IncludeToken::from(self::getOptionalAttribute($xml, 'IncludeToken', null)); } catch (ValueError) { - self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); } $elements = []; diff --git a/src/XML/sp/AbstractTokenAssertionType.php b/src/XML/sp/AbstractTokenAssertionType.php index b48829b1..ab2db718 100644 --- a/src/XML/sp/AbstractTokenAssertionType.php +++ b/src/XML/sp/AbstractTokenAssertionType.php @@ -38,8 +38,8 @@ abstract class AbstractTokenAssertionType extends AbstractSpElement * TokenAssertionType constructor. * * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|null $includeToken - * @param list<\SimpleSAML\XML\ElementInterface> $elts - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elts + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( ?IncludeToken $includeToken = null, @@ -89,7 +89,7 @@ public static function fromXML(DOMElement $xml): static try { $includeToken = IncludeToken::from(self::getOptionalAttribute($xml, 'IncludeToken', null)); } catch (ValueError) { - self::getOptionalAttribute($xml, 'IncludeToken', null); + $includeToken = self::getOptionalAttribute($xml, 'IncludeToken', null); } $elements = []; diff --git a/src/XML/wsp/AbstractOperatorContentType.php b/src/XML/wsp/AbstractOperatorContentType.php index 62776727..53341067 100644 --- a/src/XML/wsp/AbstractOperatorContentType.php +++ b/src/XML/wsp/AbstractOperatorContentType.php @@ -17,6 +17,8 @@ * Class representing a wsp:OperatorContentType element. * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractOperatorContentType extends AbstractWspElement { @@ -99,17 +101,18 @@ public static function fromXML(DOMElement $xml): static for ($n = $xml->firstChild; $n !== null; $n = $n->nextSibling) { if (!($n instanceof DOMElement)) { continue; - } elseif ($n->namespaceURI !== self::NS) { - $children[] = new Chunk($n); + } elseif ($n->namespaceURI === self::NS) { + $operatorContent[] = match ($n->localName) { + 'All' => All::fromXML($n), + 'ExactlyOne' => ExactlyOne::fromXML($n), + 'Policy' => Policy::fromXML($n), + 'PolicyReference' => PolicyReference::fromXML($n), + default => null, + }; continue; } - $operatorContent[] = match ($n->localName) { - 'All' => All::fromXML($n), - 'ExactlyOne' => ExactlyOne::fromXML($n), - 'Policy' => Policy::fromXML($n), - 'PolicyReference' => PolicyReference::fromXML($n), - }; + $children[] = new Chunk($n); } return new static($operatorContent, $children); diff --git a/src/XML/wsp/AppliesTo.php b/src/XML/wsp/AppliesTo.php index 0b2af5b0..aa92b444 100644 --- a/src/XML/wsp/AppliesTo.php +++ b/src/XML/wsp/AppliesTo.php @@ -32,8 +32,8 @@ final class AppliesTo extends AbstractWspElement /** * Initialize a wsp:AppliesTo * - * @param list<\SimpleSAML\XML\ElementInterface> $children - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct(array $children = [], array $namespacedAttributes = []) { diff --git a/src/XML/wsp/Policy.php b/src/XML/wsp/Policy.php index 4414a9ec..79e2fd91 100644 --- a/src/XML/wsp/Policy.php +++ b/src/XML/wsp/Policy.php @@ -135,6 +135,7 @@ public static function fromXML(DOMElement $xml): static 'ExactlyOne' => ExactlyOne::fromXML($n), 'Policy' => Policy::fromXML($n), 'PolicyReference' => PolicyReference::fromXML($n), + default => null, }; } diff --git a/src/XML/wsp/PolicyAttachment.php b/src/XML/wsp/PolicyAttachment.php index 4cbab15b..acb80602 100644 --- a/src/XML/wsp/PolicyAttachment.php +++ b/src/XML/wsp/PolicyAttachment.php @@ -43,8 +43,8 @@ final class PolicyAttachment extends AbstractWspElement * * @param \SimpleSAML\WSSecurity\XML\wsp\AppliesTo $appliesTo * @param (\SimpleSAML\WSSecurity\XML\wsp\Policy|\SimpleSAML\WSSecurity\XML\wsp\PolicyReference)[] $policies - * @param \SimpleSAML\XML\ElementInterface[] $children - * @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( protected AppliesTo $appliesTo, diff --git a/src/XML/wsse/AbstractAttributedString.php b/src/XML/wsse/AbstractAttributedString.php index f0b1c69e..7f5c34d1 100644 --- a/src/XML/wsse/AbstractAttributedString.php +++ b/src/XML/wsse/AbstractAttributedString.php @@ -19,6 +19,8 @@ * Abstract class defining the AttributedString type * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractAttributedString extends AbstractWsseElement { @@ -34,7 +36,7 @@ abstract class AbstractAttributedString extends AbstractWsseElement * * @param string $content * @param string|null $Id - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( string $content, diff --git a/src/XML/wsse/AbstractBinarySecurityTokenType.php b/src/XML/wsse/AbstractBinarySecurityTokenType.php index e6d173cd..bbab2b2e 100644 --- a/src/XML/wsse/AbstractBinarySecurityTokenType.php +++ b/src/XML/wsse/AbstractBinarySecurityTokenType.php @@ -29,7 +29,7 @@ abstract class AbstractBinarySecurityTokenType extends AbstractEncodedString * @param string|null $valueType * @param string|null $Id * @param string|null $EncodingType - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( string $content, diff --git a/src/XML/wsse/AbstractEmbeddedType.php b/src/XML/wsse/AbstractEmbeddedType.php index 2fa00239..6a44c15e 100644 --- a/src/XML/wsse/AbstractEmbeddedType.php +++ b/src/XML/wsse/AbstractEmbeddedType.php @@ -34,8 +34,8 @@ abstract class AbstractEmbeddedType extends AbstractWsseElement * AbstractEmbeddedType constructor * * @param string|null $valueType - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $valueType = null, diff --git a/src/XML/wsse/AbstractEncodedString.php b/src/XML/wsse/AbstractEncodedString.php index fe518565..d77aa52c 100644 --- a/src/XML/wsse/AbstractEncodedString.php +++ b/src/XML/wsse/AbstractEncodedString.php @@ -13,6 +13,8 @@ * Abstract class defining the EncodedString type * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractEncodedString extends AbstractAttributedString { @@ -22,7 +24,7 @@ abstract class AbstractEncodedString extends AbstractAttributedString * @param string $content * @param string|null $Id * @param string|null $EncodingType - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ public function __construct( string $content, diff --git a/src/XML/wsse/AbstractKeyIdentifierType.php b/src/XML/wsse/AbstractKeyIdentifierType.php index c76343c3..bf04224f 100644 --- a/src/XML/wsse/AbstractKeyIdentifierType.php +++ b/src/XML/wsse/AbstractKeyIdentifierType.php @@ -24,7 +24,7 @@ abstract class AbstractKeyIdentifierType extends AbstractEncodedString * @param string|null $valueType * @param string|null $Id * @param string|null $EncodingType - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( string $content, diff --git a/src/XML/wsse/AbstractPasswordString.php b/src/XML/wsse/AbstractPasswordString.php index 33e541a4..48d1a109 100644 --- a/src/XML/wsse/AbstractPasswordString.php +++ b/src/XML/wsse/AbstractPasswordString.php @@ -22,7 +22,7 @@ abstract class AbstractPasswordString extends AbstractAttributedString * @param string $content * @param string|null $Id * @param string|null $Type - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( string $content, diff --git a/src/XML/wsse/AbstractReferenceType.php b/src/XML/wsse/AbstractReferenceType.php index 823a6eee..0d641f0c 100644 --- a/src/XML/wsse/AbstractReferenceType.php +++ b/src/XML/wsse/AbstractReferenceType.php @@ -29,7 +29,7 @@ abstract class AbstractReferenceType extends AbstractWsseElement * * @param string|null $URI * @param string|null $valueType - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $URI = null, diff --git a/src/XML/wsse/AbstractSecurityHeaderType.php b/src/XML/wsse/AbstractSecurityHeaderType.php index d1598e40..930a6b3b 100644 --- a/src/XML/wsse/AbstractSecurityHeaderType.php +++ b/src/XML/wsse/AbstractSecurityHeaderType.php @@ -32,8 +32,8 @@ abstract class AbstractSecurityHeaderType extends AbstractWsseElement /** * AbstractSecurityHeaderType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index 1136dd48..0d61b7a5 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -39,8 +39,8 @@ abstract class AbstractSecurityTokenReferenceType extends AbstractWsseElement * * @param string|null $Id * @param string|null $Usage - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $Id = null, diff --git a/src/XML/wsse/AbstractTransformationParametersType.php b/src/XML/wsse/AbstractTransformationParametersType.php index 5618a369..31d305b9 100644 --- a/src/XML/wsse/AbstractTransformationParametersType.php +++ b/src/XML/wsse/AbstractTransformationParametersType.php @@ -32,8 +32,8 @@ abstract class AbstractTransformationParametersType extends AbstractWsseElement /** * TransformationParametersType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/wst/AbstractAuthenticatorType.php b/src/XML/wst/AbstractAuthenticatorType.php index 0b952889..2d269545 100644 --- a/src/XML/wst/AbstractAuthenticatorType.php +++ b/src/XML/wst/AbstractAuthenticatorType.php @@ -30,7 +30,7 @@ abstract class AbstractAuthenticatorType extends AbstractWstElement * AbstractAuthenticatorType constructor * * @param \SimpleSAML\WSSecurity\XML\wst\CombinedHash|null $combinedHash - * @param \SimpleSAML\XML\SerializableElementInterface[] $children + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children */ final public function __construct( protected ?CombinedHash $combinedHash = null, diff --git a/src/XML/wst/AbstractBinaryExchangeType.php b/src/XML/wst/AbstractBinaryExchangeType.php index fd108026..53f30f34 100644 --- a/src/XML/wst/AbstractBinaryExchangeType.php +++ b/src/XML/wst/AbstractBinaryExchangeType.php @@ -30,7 +30,7 @@ abstract class AbstractBinaryExchangeType extends AbstractWstElement * @param string $content * @param string $valueType * @param string $encodingType - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( string $content, diff --git a/src/XML/wst/AbstractBinarySecretType.php b/src/XML/wst/AbstractBinarySecretType.php index 4b52280f..1c142f8b 100644 --- a/src/XML/wst/AbstractBinarySecretType.php +++ b/src/XML/wst/AbstractBinarySecretType.php @@ -36,7 +36,7 @@ abstract class AbstractBinarySecretType extends AbstractWstElement /** * @param string $content * @param (\SimpleSAML\WSSecurity\XML\wst\BinarySecretTypeEnum|string)[]|null $Type - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( string $content, diff --git a/src/XML/wst/AbstractClaimsType.php b/src/XML/wst/AbstractClaimsType.php index ee74ed05..fa83e497 100644 --- a/src/XML/wst/AbstractClaimsType.php +++ b/src/XML/wst/AbstractClaimsType.php @@ -34,8 +34,8 @@ abstract class AbstractClaimsType extends AbstractWstElement * AbstractClaimsType constructor * * @param string|null $dialect - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $dialect = null, diff --git a/src/XML/wst/AbstractComputedKeyOpenEnum.php b/src/XML/wst/AbstractComputedKeyOpenEnum.php index 47599c4d..4e265ea2 100644 --- a/src/XML/wst/AbstractComputedKeyOpenEnum.php +++ b/src/XML/wst/AbstractComputedKeyOpenEnum.php @@ -18,6 +18,8 @@ * A ComputedKeyOpenEnum element * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractComputedKeyOpenEnum extends AbstractWstElement { diff --git a/src/XML/wst/AbstractEntropyType.php b/src/XML/wst/AbstractEntropyType.php index e5c668a8..5e9b1bc2 100644 --- a/src/XML/wst/AbstractEntropyType.php +++ b/src/XML/wst/AbstractEntropyType.php @@ -32,8 +32,8 @@ abstract class AbstractEntropyType extends AbstractWstElement /** * AbstractEntropyType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( array $children = [], diff --git a/src/XML/wst/AbstractKeyExchangeTokenType.php b/src/XML/wst/AbstractKeyExchangeTokenType.php index de1c4a7d..a847ec2f 100644 --- a/src/XML/wst/AbstractKeyExchangeTokenType.php +++ b/src/XML/wst/AbstractKeyExchangeTokenType.php @@ -27,7 +27,7 @@ abstract class AbstractKeyExchangeTokenType extends AbstractWstElement /** * AbstractKeyExchangeTokenType constructor * - * @param \SimpleSAML\XML\SerializableElementInterface[] $children + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children */ final public function __construct( array $children = [] diff --git a/src/XML/wst/AbstractKeyTypeOpenEnum.php b/src/XML/wst/AbstractKeyTypeOpenEnum.php index 5588bfe5..fb69814d 100644 --- a/src/XML/wst/AbstractKeyTypeOpenEnum.php +++ b/src/XML/wst/AbstractKeyTypeOpenEnum.php @@ -18,6 +18,8 @@ * A KeyTypeOpenEnum element * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractKeyTypeOpenEnum extends AbstractWstElement { diff --git a/src/XML/wst/AbstractParticipantsType.php b/src/XML/wst/AbstractParticipantsType.php index 3b792885..407f2559 100644 --- a/src/XML/wst/AbstractParticipantsType.php +++ b/src/XML/wst/AbstractParticipantsType.php @@ -29,8 +29,8 @@ abstract class AbstractParticipantsType extends AbstractWstElement * AbstractParticipantsType constructor * * @param \SimpleSAML\WSSecurity\XML\wst\Primary|null $primary - * @param \SimpleSAML\WSSecurity\XML\wst\Participant[] $participant - * @param \SimpleSAML\XML\SerializableElementInterface[] $children + * @param array<\SimpleSAML\WSSecurity\XML\wst\Participant> $participant + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children */ final public function __construct( protected ?Primary $primary = null, diff --git a/src/XML/wst/AbstractRequestSecurityTokenCollectionType.php b/src/XML/wst/AbstractRequestSecurityTokenCollectionType.php index 9bec9fc2..bc87e9a6 100644 --- a/src/XML/wst/AbstractRequestSecurityTokenCollectionType.php +++ b/src/XML/wst/AbstractRequestSecurityTokenCollectionType.php @@ -18,7 +18,7 @@ abstract class AbstractRequestSecurityTokenCollectionType extends AbstractWstElement { /** - * @param \SimpleSAML\WSSecurity\XML\wst\RequestSecurityToken[] $requestSecurityToken + * @param array<\SimpleSAML\WSSecurity\XML\wst\RequestSecurityToken> $requestSecurityToken */ final public function __construct( protected array $requestSecurityToken diff --git a/src/XML/wst/AbstractRequestSecurityTokenResponseCollectionType.php b/src/XML/wst/AbstractRequestSecurityTokenResponseCollectionType.php index 033d93f9..f72f36e5 100644 --- a/src/XML/wst/AbstractRequestSecurityTokenResponseCollectionType.php +++ b/src/XML/wst/AbstractRequestSecurityTokenResponseCollectionType.php @@ -26,8 +26,8 @@ abstract class AbstractRequestSecurityTokenResponseCollectionType extends Abstra /** - * @param \SimpleSAML\WSSecurity\XML\wst\RequestSecurityTokenResponse[] $requestSecurityTokenResponse - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\WSSecurity\XML\wst\RequestSecurityTokenResponse> $requestSecurityTokenResponse + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected array $requestSecurityTokenResponse, diff --git a/src/XML/wst/AbstractRequestSecurityTokenResponseType.php b/src/XML/wst/AbstractRequestSecurityTokenResponseType.php index 53c8886e..ef7a7b9b 100644 --- a/src/XML/wst/AbstractRequestSecurityTokenResponseType.php +++ b/src/XML/wst/AbstractRequestSecurityTokenResponseType.php @@ -38,8 +38,8 @@ abstract class AbstractRequestSecurityTokenResponseType extends AbstractWstEleme * AbstractRequestSecurityTokenResponseType constructor * * @param string|null $context - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Attributes[] $namepacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $context = null, diff --git a/src/XML/wst/AbstractRequestSecurityTokenType.php b/src/XML/wst/AbstractRequestSecurityTokenType.php index bd977b55..918ef00c 100644 --- a/src/XML/wst/AbstractRequestSecurityTokenType.php +++ b/src/XML/wst/AbstractRequestSecurityTokenType.php @@ -21,6 +21,8 @@ * Class defining the RequestSecurityTokenType element * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement { @@ -38,8 +40,8 @@ abstract class AbstractRequestSecurityTokenType extends AbstractWstElement * AbstractRequestSecurityTokenType constructor * * @param string|null $context - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Attributes[] $namepacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?string $context = null, diff --git a/src/XML/wst/AbstractRequestTypeOpenEnum.php b/src/XML/wst/AbstractRequestTypeOpenEnum.php index f08d1f18..f2fa505c 100644 --- a/src/XML/wst/AbstractRequestTypeOpenEnum.php +++ b/src/XML/wst/AbstractRequestTypeOpenEnum.php @@ -18,6 +18,8 @@ * A RequestTypeOpenEnum element * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractRequestTypeOpenEnum extends AbstractWstElement { diff --git a/src/XML/wst/AbstractSignChallengeType.php b/src/XML/wst/AbstractSignChallengeType.php index 772314cf..70de8eb9 100644 --- a/src/XML/wst/AbstractSignChallengeType.php +++ b/src/XML/wst/AbstractSignChallengeType.php @@ -35,8 +35,8 @@ abstract class AbstractSignChallengeType extends AbstractWstElement * AbstractSignChallengeType constructor * * @param \SimpleSAML\WSSecurity\XML\wst\Challenge|null $challenge - * @param \SimpleSAML\XML\SerializableElementInterface[] $children - * @param \SimpleSAML\XML\Attribute[] $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $children + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?Challenge $challenge = null, diff --git a/src/XML/wst/AbstractStatusCodeOpenEnum.php b/src/XML/wst/AbstractStatusCodeOpenEnum.php index 95260813..c2ae72bd 100644 --- a/src/XML/wst/AbstractStatusCodeOpenEnum.php +++ b/src/XML/wst/AbstractStatusCodeOpenEnum.php @@ -18,6 +18,8 @@ * A StatusCodeOpenEnum element * * @package simplesamlphp/ws-security + * + * @phpstan-consistent-constructor */ abstract class AbstractStatusCodeOpenEnum extends AbstractWstElement { diff --git a/src/XML/wsu/AbstractAttributedDateTime.php b/src/XML/wsu/AbstractAttributedDateTime.php index e7576ac6..93c5d978 100644 --- a/src/XML/wsu/AbstractAttributedDateTime.php +++ b/src/XML/wsu/AbstractAttributedDateTime.php @@ -32,7 +32,7 @@ abstract class AbstractAttributedDateTime extends AbstractWsuElement * * @param \DateTimeImmutable $dateTime * @param string|null $Id - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected DateTimeImmutable $dateTime, diff --git a/src/XML/wsu/AbstractAttributedURI.php b/src/XML/wsu/AbstractAttributedURI.php index 0c385312..d3916296 100644 --- a/src/XML/wsu/AbstractAttributedURI.php +++ b/src/XML/wsu/AbstractAttributedURI.php @@ -31,7 +31,7 @@ abstract class AbstractAttributedURI extends AbstractWsuElement * * @param string $uri * @param string|null $Id - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final protected function __construct( string $uri, diff --git a/src/XML/wsu/AbstractTimestamp.php b/src/XML/wsu/AbstractTimestamp.php index 6b60a5c9..534482ff 100644 --- a/src/XML/wsu/AbstractTimestamp.php +++ b/src/XML/wsu/AbstractTimestamp.php @@ -38,8 +38,8 @@ abstract class AbstractTimestamp extends AbstractWsuElement * @param \SimpleSAML\WSSecurity\XML\wsu\Created|null $created * @param \SimpleSAML\WSSecurity\XML\wsu\Expires|null $expires * @param string|null $Id - * @param array $elements - * @param array $namespacedAttributes + * @param array<\SimpleSAML\XML\SerializableElementInterface> $elements + * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes */ final public function __construct( protected ?Created $created = null, @@ -144,12 +144,11 @@ public static function fromXML(DOMElement $xml): static /** * Convert this Timestamp to XML. * - * @param \DOMElement|null $element The element we are converting to XML. + * @param \DOMElement|null $parent The element we should append this class to. * @return \DOMElement The XML element after adding the data corresponding to this Timestamp. */ public function toXML(DOMElement $parent = null): DOMElement { - /** @psalm-var \DOMDocument $e->ownerDocument */ $e = $this->instantiateParentElement($parent); $attributes = $this->getAttributesNS(); diff --git a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php index 831055dd..c3eed067 100644 --- a/tests/WSSecurity/XML/auth/ConstrainedValueTest.php +++ b/tests/WSSecurity/XML/auth/ConstrainedValueTest.php @@ -31,7 +31,7 @@ final class ConstrainedValueTest extends TestCase { private static string $resourcePath; - private static StructuredValue $structuredValue; + //private static StructuredValue $structuredValue; private static Value $value; @@ -47,10 +47,12 @@ public static function setUpBeforeClass(): void 'SomeChunk', ); +/** self::$structuredValue = new StructuredValue( [new Chunk($child->documentElement)], [$attr1], ); +*/ self::$value = new Value('MyValue'); } diff --git a/tests/WSSecurity/XML/wsp/AppliesToTest.php b/tests/WSSecurity/XML/wsp/AppliesToTest.php index 58300d2f..ada96f17 100644 --- a/tests/WSSecurity/XML/wsp/AppliesToTest.php +++ b/tests/WSSecurity/XML/wsp/AppliesToTest.php @@ -30,9 +30,6 @@ final class AppliesToTest extends TestCase use SchemaValidationTestTrait; use SerializableElementTestTrait; - /** @var \DOMElement $AppliesToContent */ - private static DOMElement $AppliesToContent; - /** */