Skip to content

Commit 6522c9a

Browse files
tvdijenioigoume
andauthored
Migrate to xsd-types (#374)
* Migrate to xsd-types --------- Co-authored-by: Ioannis Igoumenos <[email protected]>
1 parent ce6bf2d commit 6522c9a

File tree

427 files changed

+8352
-5889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+8352
-5889
lines changed

.github/workflows/interoperability.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ jobs:
8282
wget https://mds.edugain.org/edugain-v2.xml -O /tmp/metadata/edugain.xml
8383
wget https://technical.edugain.org/mds-v2.cer -O /tmp/metadata/edugain-pub.crt
8484
85+
- name: Download eduID metadata & public key
86+
if: steps.cache-metadata.outputs.cache-hit != 'true'
87+
run: |
88+
mkdir -p /tmp/metadata
89+
wget https://metadata.eduid.cz/entities/eduid -O /tmp/metadata/eduid.xml
90+
wget https://www.eduid.cz/docs/eduid/metadata/metadata.eduid.cz.crt.pem -O /tmp/metadata/eduid.crt
8591
8692
- name: Download eduID metadata & public key
8793
if: steps.cache-metadata.outputs.cache-hit != 'true'

composer.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
"ext-pcre": "*",
2727
"ext-zlib": "*",
2828

29-
"nyholm/psr7": "~1.8.2",
30-
"psr/clock": "~1.0.0",
29+
"nyholm/psr7": "~1.8",
30+
"psr/clock": "~1.0",
3131
"psr/http-message": "~2.0",
32-
"psr/log": "~2.3.1 || ~3.0.0",
33-
"simplesamlphp/assert": "~1.8.1",
34-
"simplesamlphp/xml-common": "~1.25.0",
35-
"simplesamlphp/xml-security": "~1.13.4",
36-
"simplesamlphp/xml-soap": "~1.7.0"
32+
"psr/log": "~2.3 || ~3.0",
33+
"simplesamlphp/assert": "~1.9",
34+
"simplesamlphp/xml-common": "~2.3",
35+
"simplesamlphp/xml-security": "~2.0",
36+
"simplesamlphp/xml-soap": "~2.0"
3737
},
3838
"require-dev": {
3939
"ext-intl": "*",
4040

41-
"beste/clock": "~3.0.0",
42-
"mockery/mockery": "~1.6.12",
43-
"simplesamlphp/simplesamlphp-test-framework": "~1.10.2"
41+
"beste/clock": "~3.0",
42+
"mockery/mockery": "~1.6",
43+
"simplesamlphp/simplesamlphp-test-framework": "~1.10"
4444
},
4545
"suggest": {
4646
"ext-soap": "*"
@@ -58,7 +58,7 @@
5858
},
5959
"extra": {
6060
"branch-alias": {
61-
"dev-master": "v6.0.x-dev"
61+
"dev-master": "v5.1.x-dev"
6262
}
6363
},
6464
"config": {
@@ -69,5 +69,15 @@
6969
"phpstan/extension-installer": true,
7070
"simplesamlphp/composer-xmlprovider-installer": true
7171
}
72+
},
73+
"scripts": {
74+
"pre-commit": [
75+
"vendor/bin/phpcs -p",
76+
"vendor/bin/composer-require-checker check --config-file=tools/composer-require-checker.json composer.json",
77+
"vendor/bin/phpstan analyze -c phpstan.neon",
78+
"vendor/bin/phpstan analyze -c phpstan-dev.neon",
79+
"vendor/bin/composer-unused",
80+
"vendor/bin/phpunit --no-coverage --testdox"
81+
]
7282
}
7383
}

phpcs.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
<exclude-pattern>tests/SAML2/XML/saml/AuthnContextTest.php</exclude-pattern>
4242
<exclude-pattern>tests/SAML2/XML/saml/EncryptedAssertionTest.php</exclude-pattern>
4343
<exclude-pattern>tests/SAML2/XML/saml/EncryptedIDTest.php</exclude-pattern>
44+
<exclude-pattern>tests/SAML2/XML/saml/SubjectConfirmationTest.php</exclude-pattern>
45+
<exclude-pattern>tests/SAML2/XML/samlp/AuthnRequestTest.php</exclude-pattern>
4446
<exclude-pattern>tests/SAML2/XML/samlp/RequestedAuthnContextTest.php</exclude-pattern>
4547
<exclude-pattern>tests/SAML2/XML/samlp/StatusDetailTest.php</exclude-pattern>
4648
<exclude-pattern>tests/SAML2/XML/shibmd/KeyAuthorityTest.php</exclude-pattern>

phpstan-baseline-dev.neon

Lines changed: 120 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: '#^Dead catch \- SimpleSAML\\Assert\\AssertionFailedException is never thrown in the try block\.$#'
5+
identifier: catch.neverThrown
6+
count: 1
7+
path: tests/InterOperability/EntityDescriptorTest.php
8+
9+
-
10+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\Utilities\\\\ArrayCollection'' and SimpleSAML\\SAML2\\Utilities\\ArrayCollection will always evaluate to true\.$#'
11+
identifier: staticMethod.alreadyNarrowedType
12+
count: 1
13+
path: tests/SAML2/Assertion/ProcessorTest.php
14+
315
-
416
message: '#^PHPDoc tag @var for property SimpleSAML\\Test\\SAML2\\Assertion\\Transformer\\NameIdDecryptionTransformerTest\:\:\$validator with type SimpleSAML\\SAML2\\Response\\Validation\\Validator is incompatible with native type SimpleSAML\\SAML2\\Signature\\Validator\.$#'
517
identifier: property.phpDocType
@@ -30,12 +42,24 @@ parameters:
3042
count: 1
3143
path: tests/SAML2/Assertion/Validation/AssertionValidatorTest.php
3244

45+
-
46+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
47+
identifier: phpunit.callParent
48+
count: 1
49+
path: tests/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudienceTest.php
50+
3351
-
3452
message: '#^Parameter \#1 \$serviceProvider of method SimpleSAML\\SAML2\\Assertion\\Validation\\ConstraintValidator\\SpIsValidAudience\:\:setServiceProvider\(\) expects SimpleSAML\\SAML2\\Configuration\\ServiceProvider, Mockery\\MockInterface given\.$#'
3553
identifier: argument.type
3654
count: 3
3755
path: tests/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudienceTest.php
3856

57+
-
58+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
59+
identifier: phpunit.callParent
60+
count: 1
61+
path: tests/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatchesTest.php
62+
3963
-
4064
message: '#^Parameter \#1 \$response of class SimpleSAML\\SAML2\\Assertion\\Validation\\ConstraintValidator\\SubjectConfirmationResponseToMatches constructor expects SimpleSAML\\SAML2\\XML\\samlp\\Response, Mockery\\MockInterface given\.$#'
4165
identifier: argument.type
@@ -60,32 +84,122 @@ parameters:
6084
count: 3
6185
path: tests/SAML2/Certificate/KeyLoaderTest.php
6286

87+
-
88+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
89+
identifier: phpunit.callParent
90+
count: 1
91+
path: tests/SAML2/Certificate/KeyLoaderTest.php
92+
6393
-
6494
message: '#^Parameter \#1 \$config of method SimpleSAML\\SAML2\\Certificate\\KeyLoader\:\:loadKeysFromConfiguration\(\) expects SimpleSAML\\SAML2\\Configuration\\CertificateProvider, Mockery\\MockInterface given\.$#'
6595
identifier: argument.type
6696
count: 3
6797
path: tests/SAML2/Certificate/KeyLoaderTest.php
6898

99+
-
100+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\XMLSecurity\\\\Key\\\\PrivateKey'' and SimpleSAML\\XMLSecurity\\Key\\PrivateKey will always evaluate to true\.$#'
101+
identifier: method.alreadyNarrowedType
102+
count: 1
103+
path: tests/SAML2/Certificate/PrivateKeyLoaderTest.php
104+
105+
-
106+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
107+
identifier: phpunit.callParent
108+
count: 1
109+
path: tests/SAML2/Response/SignatureValidationTest.php
110+
111+
-
112+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
113+
identifier: phpunit.callParent
114+
count: 1
115+
path: tests/SAML2/Response/Validation/ConstraintValidator/DestinationMatchesTest.php
116+
69117
-
70118
message: '#^Parameter \#1 \$response of method SimpleSAML\\SAML2\\Response\\Validation\\ConstraintValidator\\DestinationMatches\:\:validate\(\) expects SimpleSAML\\SAML2\\XML\\samlp\\Response, Mockery\\MockInterface given\.$#'
71119
identifier: argument.type
72120
count: 2
73121
path: tests/SAML2/Response/Validation/ConstraintValidator/DestinationMatchesTest.php
74122

123+
-
124+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
125+
identifier: phpunit.callParent
126+
count: 1
127+
path: tests/SAML2/Response/Validation/ConstraintValidator/IsSuccessfulTest.php
128+
75129
-
76130
message: '#^Parameter \#1 \$response of method SimpleSAML\\SAML2\\Response\\Validation\\ConstraintValidator\\IsSuccessful\:\:validate\(\) expects SimpleSAML\\SAML2\\XML\\samlp\\Response, Mockery\\MockInterface given\.$#'
77131
identifier: argument.type
78132
count: 2
79133
path: tests/SAML2/Response/Validation/ConstraintValidator/IsSuccessfulTest.php
80134

81135
-
82-
message: '#^Parameter \#1 \$xml of static method SimpleSAML\\SAML2\\XML\\saml\\Assertion\:\:fromXML\(\) expects DOMElement, DOMNode\|null given\.$#'
83-
identifier: argument.type
136+
message: '#^Missing call to parent\:\:setUp\(\) method\.$#'
137+
identifier: phpunit.callParent
138+
count: 1
139+
path: tests/SAML2/Signature/PublicKeyValidatorTest.php
140+
141+
-
142+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''ArrayIterator'' and ArrayIterator will always evaluate to true\.$#'
143+
identifier: method.alreadyNarrowedType
144+
count: 1
145+
path: tests/SAML2/Utilities/ArrayCollectionTest.php
146+
147+
-
148+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\Utilities\\\\ArrayCollection'' and SimpleSAML\\SAML2\\Utilities\\ArrayCollection will always evaluate to true\.$#'
149+
identifier: method.alreadyNarrowedType
84150
count: 2
85-
path: tests/SAML2/Response/XmlSignatureWrappingTest.php
151+
path: tests/SAML2/Utilities/ArrayCollectionTest.php
86152

87153
-
88-
message: '#^Parameter \#1 \$requestedAuthnContexts of class SimpleSAML\\SAML2\\XML\\samlp\\RequestedAuthnContext constructor expects array\<SimpleSAML\\SAML2\\XML\\saml\\AuthnContextClassRef\|SimpleSAML\\SAML2\\XML\\saml\\AuthnContextDeclRef\>, array\<int, DOMDocument\|SimpleSAML\\SAML2\\XML\\saml\\AuthnContextDeclRef\> given\.$#'
89-
identifier: argument.type
154+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AdditionalMetadataLocation'' and SimpleSAML\\SAML2\\XML\\md\\AdditionalMetadataLocation will always evaluate to true\.$#'
155+
identifier: method.alreadyNarrowedType
156+
count: 2
157+
path: tests/SAML2/XML/md/EntityDescriptorTest.php
158+
159+
-
160+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\ContactPerson'' and SimpleSAML\\SAML2\\XML\\md\\ContactPerson will always evaluate to true\.$#'
161+
identifier: method.alreadyNarrowedType
162+
count: 3
163+
path: tests/SAML2/XML/md/EntityDescriptorTest.php
164+
165+
-
166+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\SingleSignOnService'' and SimpleSAML\\SAML2\\XML\\md\\SingleSignOnService will always evaluate to true\.$#'
167+
identifier: method.alreadyNarrowedType
168+
count: 1
169+
path: tests/SAML2/XML/md/IDPSSODescriptorTest.php
170+
171+
-
172+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor'' and SimpleSAML\\SAML2\\XML\\md\\AbstractRoleDescriptor will always evaluate to true\.$#'
173+
identifier: method.alreadyNarrowedType
174+
count: 1
175+
path: tests/SAML2/XML/md/RoleDescriptorTest.php
176+
177+
-
178+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\ContactPerson'' and SimpleSAML\\SAML2\\XML\\md\\ContactPerson will always evaluate to true\.$#'
179+
identifier: method.alreadyNarrowedType
180+
count: 4
181+
path: tests/SAML2/XML/md/RoleDescriptorTest.php
182+
183+
-
184+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\KeyDescriptor'' and SimpleSAML\\SAML2\\XML\\md\\KeyDescriptor will always evaluate to true\.$#'
185+
identifier: method.alreadyNarrowedType
186+
count: 4
187+
path: tests/SAML2/XML/md/RoleDescriptorTest.php
188+
189+
-
190+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\NameID'' and SimpleSAML\\SAML2\\XML\\saml\\NameID will always evaluate to true\.$#'
191+
identifier: method.alreadyNarrowedType
192+
count: 1
193+
path: tests/SAML2/XML/saml/AssertionTest.php
194+
195+
-
196+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\NameID'' and array\<SimpleSAML\\SAML2\\XML\\saml\\AttributeValue\|SimpleSAML\\SAML2\\XML\\saml\\IdentifierInterface\> will always evaluate to false\.$#'
197+
identifier: method.impossibleType
198+
count: 4
199+
path: tests/SAML2/XML/saml/AssertionTest.php
200+
201+
-
202+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''SimpleSAML\\\\Test\\\\SAML2\\\\CustomStatement'' and SimpleSAML\\Test\\SAML2\\CustomStatement will always evaluate to true\.$#'
203+
identifier: method.alreadyNarrowedType
90204
count: 1
91-
path: tests/SAML2/XML/samlp/RequestedAuthnContextTest.php
205+
path: tests/SAML2/XML/saml/StatementTest.php

0 commit comments

Comments
 (0)