Skip to content

Commit

Permalink
Fix PHPStan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jan 28, 2024
1 parent 8c46011 commit 6300c9a
Show file tree
Hide file tree
Showing 67 changed files with 139 additions and 127 deletions.
2 changes: 1 addition & 1 deletion phpstan-dev.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parameters:
level: 9
level: 4
paths:
- tests
4 changes: 2 additions & 2 deletions src/XML/auth/AbstractStructuredValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down
2 changes: 1 addition & 1 deletion src/XML/auth/AbstractValueInRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down
1 change: 1 addition & 0 deletions src/XML/fed/AbstractApplicationServiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractAssertionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractClaimDialectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/XML/fed/AbstractClaimDialectsOfferedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -44,7 +44,7 @@ final public function __construct(


/**
* @return array
* @return array<\SimpleSAML\WSSecurity\XML\fed\ClaimDialect>
*/
public function getClaimDialect(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractEndpointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -31,7 +31,7 @@ final public function __construct(


/**
* @return array
* @return array<\SimpleSAML\WSSecurity\XML\wsa\EndpointReference>
*/
public function getEndpointReference(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractFilterPseudonymsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractFreshnessType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractIssuerNameType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/XML/fed/AbstractLogicalServiceNamesOfferedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -44,7 +44,7 @@ final public function __construct(


/**
* @return array
* @return array<\SimpleSAML\WSSecurity\XML\fed\IssuerName>
*/
public function getIssuerName(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractProofTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/XML/fed/AbstractPseudonymType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/XML/fed/AbstractReferenceTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand All @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractRequestProofTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractRequestPseudonymType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/fed/AbstractSecurityTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractSignOutBasisType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractSignOutType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/XML/fed/AbstractTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/XML/fed/AbstractTokenTypesOfferedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -53,7 +53,7 @@ final public function __construct(


/**
* @return array
* @return array<\SimpleSAML\WSSecurity\XML\fed\TokenType>
*/
public function getTokenType(): array
{
Expand Down
4 changes: 0 additions & 4 deletions src/XML/fed/AbstractWebServiceDescriptorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/XML/sp/AbstractIssuedTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 = [];
Expand Down
4 changes: 2 additions & 2 deletions src/XML/sp/AbstractKeyValueTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion src/XML/sp/AbstractReqPartsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/XML/sp/AbstractRequestSecurityTokenTemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/sp/AbstractSePartsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/XML/sp/AbstractSecureConversationTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = [];
Expand Down
Loading

0 comments on commit 6300c9a

Please sign in to comment.