Fix several issue reported by PHPstan #2773
php.yml
on: push
Annotations
21 errors and 14 warnings
InvalidArgument:
src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php#L101
src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php:101:25: InvalidArgument: Argument 1 of SimpleSAML\SAML2\XML\saml\Subject::__construct expects SimpleSAML\SAML2\XML\saml\IdentifierInterface|null, but SimpleSAML\XML\ElementInterface provided (see https://psalm.dev/004)
|
RiskyTruthyFalsyComparison:
src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php#L41
src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php:41:13: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
|
RiskyTruthyFalsyComparison:
src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php#L42
src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php:42:13: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
|
PossiblyInvalidArgument:
src/SAML2/Binding.php#L101
src/SAML2/Binding.php:101:53: PossiblyInvalidArgument: Argument 2 of array_key_exists expects array<array-key, mixed>, but possibly different type array<array-key, mixed>|null|object provided (see https://psalm.dev/092)
|
PossiblyInvalidArgument:
src/SAML2/Binding.php#L101
src/SAML2/Binding.php:101:97: PossiblyInvalidArgument: Argument 2 of array_key_exists expects array<array-key, mixed>, but possibly different type array<array-key, mixed>|null|object provided (see https://psalm.dev/092)
|
PossiblyInvalidArgument:
src/SAML2/Binding.php#L103
src/SAML2/Binding.php:103:55: PossiblyInvalidArgument: Argument 2 of array_key_exists expects array<array-key, mixed>, but possibly different type array<array-key, mixed>|null|object provided (see https://psalm.dev/092)
|
MissingTemplateParam:
src/SAML2/Certificate/Key.php#L19
src/SAML2/Certificate/Key.php:19:22: MissingTemplateParam: SimpleSAML\SAML2\Certificate\Key has missing template params when extending ArrayAccess, expecting 2 (see https://psalm.dev/182)
|
RiskyTruthyFalsyComparison:
src/SAML2/Certificate/KeyLoader.php#L108
src/SAML2/Certificate/KeyLoader.php:108:17: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
|
RiskyTruthyFalsyComparison:
src/SAML2/Certificate/PrivateKey.php#L18
src/SAML2/Certificate/PrivateKey.php:18:13: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
|
UndefinedClass:
src/SAML2/Certificate/PrivateKeyLoader.php#L48
src/SAML2/Certificate/PrivateKeyLoader.php:48:24: UndefinedClass: Class, interface or enum named SimpleSAML\XMLSecurity\XMLSecurityKey does not exist (see https://psalm.dev/019)
|
UndefinedPropertyFetch:
tests/SAML2/XML/md/EncryptionMethodTest.php#L108
tests/SAML2/XML/md/EncryptionMethodTest.php:108:35: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/mdui/UIInfoTest.php#L158
tests/SAML2/XML/mdui/UIInfoTest.php:158:61: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/saml/AssertionTest.php#L1200
tests/SAML2/XML/saml/AssertionTest.php:1200:43: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/AbstractMessageTest.php#L146
tests/SAML2/XML/samlp/AbstractMessageTest.php:146:52: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/AbstractStatusResponseTest.php#L83
tests/SAML2/XML/samlp/AbstractStatusResponseTest.php:83:47: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/AttributeQueryTest.php#L164
tests/SAML2/XML/samlp/AttributeQueryTest.php:164:45: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/AttributeQueryTest.php#L165
tests/SAML2/XML/samlp/AttributeQueryTest.php:165:45: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/LogoutRequestTest.php#L85
tests/SAML2/XML/samlp/LogoutRequestTest.php:85:44: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/LogoutRequestTest.php#L89
tests/SAML2/XML/samlp/LogoutRequestTest.php:89:50: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
UndefinedPropertyFetch:
tests/SAML2/XML/samlp/LogoutRequestTest.php#L102
tests/SAML2/XML/samlp/LogoutRequestTest.php:102:51: UndefinedPropertyFetch: Instance property DOMNameSpaceNode::$textContent is not defined (see https://psalm.dev/039)
|
Quality control
Process completed with exit code 1.
|
InvalidDocblockParamName:
src/SAML2/XML/md/AttributeAuthorityDescriptor.php#L31
src/SAML2/XML/md/AttributeAuthorityDescriptor.php:31:68: InvalidDocblockParamName: Incorrect param name $asssertionIDRequestService in docblock for SimpleSAML\SAML2\XML\md\AttributeAuthorityDescriptor::__construct (see https://psalm.dev/187)
|
InvalidDocblock:
src/SAML2/XML/md/AuthnAuthorityDescriptor.php#L41
src/SAML2/XML/md/AuthnAuthorityDescriptor.php:41:5: InvalidDocblock: Badly-formatted @param in docblock for SimpleSAML\SAML2\XML\md\AuthnAuthorityDescriptor::__construct (see https://psalm.dev/008)
|
InvalidDocblock:
src/SAML2/XML/md/PDPDescriptor.php#L41
src/SAML2/XML/md/PDPDescriptor.php:41:5: InvalidDocblock: Badly-formatted @param in docblock for SimpleSAML\SAML2\XML\md\PDPDescriptor::__construct (see https://psalm.dev/008)
|
InvalidDocblockParamName:
src/SAML2/XML/mdui/UIInfo.php#L231
src/SAML2/XML/mdui/UIInfo.php:231:8: InvalidDocblockParamName: Incorrect param name $items in docblock for SimpleSAML\SAML2\XML\mdui\UIInfo::testLocalizedElements (see https://psalm.dev/187)
|
PossiblyNullPropertyFetch:
tests/SAML2/XML/md/EncryptionMethodTest.php#L108
tests/SAML2/XML/md/EncryptionMethodTest.php:108:35: PossiblyNullPropertyFetch: Cannot get property on possibly null variable $keySizeElements[0] of type DOMNameSpaceNode|DOMNode|null (see https://psalm.dev/082)
|
PossiblyNullReference:
tests/SAML2/XML/md/EntityDescriptorTest.php#L276
tests/SAML2/XML/md/EntityDescriptorTest.php:276:75: PossiblyNullReference: Cannot call method format on possibly null value (see https://psalm.dev/083)
|
PossiblyNullReference:
tests/SAML2/XML/md/EntityDescriptorTest.php#L393
tests/SAML2/XML/md/EntityDescriptorTest.php:393:89: PossiblyNullReference: Cannot call method format on possibly null value (see https://psalm.dev/083)
|
PossiblyNullReference:
tests/SAML2/XML/md/RoleDescriptorTest.php#L185
tests/SAML2/XML/md/RoleDescriptorTest.php:185:83: PossiblyNullReference: Cannot call method format on possibly null value (see https://psalm.dev/083)
|
PossiblyNullReference:
tests/SAML2/XML/md/RoleDescriptorTest.php#L233
tests/SAML2/XML/md/RoleDescriptorTest.php:233:83: PossiblyNullReference: Cannot call method format on possibly null value (see https://psalm.dev/083)
|
PossiblyNullReference:
tests/SAML2/XML/md/RoleDescriptorTest.php#L251
tests/SAML2/XML/md/RoleDescriptorTest.php:251:54: PossiblyNullReference: Cannot call method saveXML on possibly null value (see https://psalm.dev/083)
|
PossiblyInvalidArgument:
tests/SAML2/XML/mdui/UIInfoTest.php#L151
tests/SAML2/XML/mdui/UIInfoTest.php:151:36: PossiblyInvalidArgument: Argument 1 of SimpleSAML\SAML2\Utils\XPath::getXPath expects DOMNode, but possibly different type DOMNameSpaceNode|DOMNode|null provided (see https://psalm.dev/092)
|
PossiblyInvalidArgument:
tests/SAML2/XML/mdui/UIInfoTest.php#L153
tests/SAML2/XML/mdui/UIInfoTest.php:153:13: PossiblyInvalidArgument: Argument 1 of SimpleSAML\SAML2\Utils\XPath::xpQuery expects DOMNode, but possibly different type DOMNameSpaceNode|DOMNode|null provided (see https://psalm.dev/092)
|
PossiblyNullPropertyFetch:
tests/SAML2/XML/mdui/UIInfoTest.php#L158
tests/SAML2/XML/mdui/UIInfoTest.php:158:61: PossiblyNullPropertyFetch: Cannot get property on possibly null variable $logoElements[0] of type DOMNameSpaceNode|DOMNode|null (see https://psalm.dev/082)
|
PossiblyInvalidArgument:
tests/SAML2/XML/mdui/UIInfoTest.php#L160
tests/SAML2/XML/mdui/UIInfoTest.php:160:36: PossiblyInvalidArgument: Argument 1 of SimpleSAML\SAML2\Utils\XPath::getXPath expects DOMNode, but possibly different type DOMNameSpaceNode|DOMNode|null provided (see https://psalm.dev/092)
|