@@ -7,7 +7,6 @@ |
||
7 | 7 | use LightSaml\Criteria\CriteriaSet; |
8 | 8 | use LightSaml\Resolver\Credential\PrivateKeyResolver; |
9 | 9 | use LightSaml\Tests\BaseTestCase; |
10 | -use RobRichards\XMLSecLibs\XMLSecurityKey; |
|
11 | 10 | |
12 | 11 | class PrivateKeyResolverTest extends BaseTestCase |
13 | 12 | { |
@@ -39,11 +39,11 @@ |
||
39 | 39 | { |
40 | 40 | $criteriaSet = new CriteriaSet(); |
41 | 41 | |
42 | - $criteriaSet->addIf(false, function () { |
|
42 | + $criteriaSet->addIf(false, function() { |
|
43 | 43 | return $this->getCriteriaMock(); |
44 | 44 | |
45 | 45 | }); |
46 | - $criteriaSet->addIf(true, function () { |
|
46 | + $criteriaSet->addIf(true, function() { |
|
47 | 47 | return $this->getCriteriaMock(); |
48 | 48 | |
49 | 49 | }); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $message = new AuthnRequest(); |
19 | 19 | $context = $this->createContext(ProfileContext::ROLE_IDP, $message); |
20 | 20 | |
21 | - $this->setEndpointResolver(true, function (CriteriaSet $criteriaSet) { |
|
21 | + $this->setEndpointResolver(true, function(CriteriaSet $criteriaSet) { |
|
22 | 22 | $this->criteriaSetShouldHaveServiceTypeCriteria($criteriaSet, SingleSignOnService::class); |
23 | 23 | |
24 | 24 | return [$this->getEndpointReferenceMock($endpoint = new SingleSignOnService())]; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $message = new AuthnRequest(); |
19 | 19 | $context = $this->createContext(ProfileContext::ROLE_IDP, $message); |
20 | 20 | |
21 | - $this->setEndpointResolver(true, function (CriteriaSet $criteriaSet) { |
|
21 | + $this->setEndpointResolver(true, function(CriteriaSet $criteriaSet) { |
|
22 | 22 | $this->criteriaSetShouldHaveServiceTypeCriteria($criteriaSet, AssertionConsumerService::class); |
23 | 23 | |
24 | 24 | return [$this->getEndpointReferenceMock($endpoint = new AssertionConsumerService())]; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $context->getOwnEntityContext()->setEntityDescriptor(new EntityDescriptor($ownEntityId = 'http://own.id')); |
37 | 37 | $context->getLogoutContext()->setSsoSessionState((new SsoSessionState())->setIdpEntityId($ownEntityId)); |
38 | 38 | |
39 | - $this->setEndpointResolver(true, function (CriteriaSet $criteriaSet) { |
|
39 | + $this->setEndpointResolver(true, function(CriteriaSet $criteriaSet) { |
|
40 | 40 | $this->criteriaSetShouldHaveServiceTypeCriteria($criteriaSet, SingleLogoutService::class); |
41 | 41 | |
42 | 42 | return [$this->getEndpointReferenceMock($endpoint = new SingleLogoutService())]; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $context->getOwnEntityContext()->setEntityDescriptor(new EntityDescriptor($ownEntityId = 'http://own.id')); |
54 | 54 | $context->getLogoutContext()->setSsoSessionState((new SsoSessionState())->setIdpEntityId($ownEntityId)); |
55 | 55 | |
56 | - $this->setEndpointResolver(true, function (CriteriaSet $criteriaSet) { |
|
56 | + $this->setEndpointResolver(true, function(CriteriaSet $criteriaSet) { |
|
57 | 57 | $this->criteriaSetShouldHaveDescriptorTypeCriteria($criteriaSet, SpSsoDescriptor::class); |
58 | 58 | |
59 | 59 | return [$this->getEndpointReferenceMock($endpoint = new SingleLogoutService())]; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $context->getOwnEntityContext()->setEntityDescriptor(new EntityDescriptor($ownEntityId = 'http://own.id')); |
71 | 71 | $context->getLogoutContext()->setSsoSessionState((new SsoSessionState())->setSpEntityId($ownEntityId)); |
72 | 72 | |
73 | - $this->setEndpointResolver(true, function (CriteriaSet $criteriaSet) { |
|
73 | + $this->setEndpointResolver(true, function(CriteriaSet $criteriaSet) { |
|
74 | 74 | $this->criteriaSetShouldHaveDescriptorTypeCriteria($criteriaSet, IdpSsoDescriptor::class); |
75 | 75 | |
76 | 76 | return [$this->getEndpointReferenceMock($endpoint = new SingleLogoutService())]; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $endpointResolver->expects($this->once()) |
97 | 97 | ->method('resolve') |
98 | 98 | ->with($this->isInstanceOf(CriteriaSet::class), $this->isType('array')) |
99 | - ->willReturnCallback(function (CriteriaSet $criteriaSet) use ($recipient) { |
|
99 | + ->willReturnCallback(function(CriteriaSet $criteriaSet) use ($recipient) { |
|
100 | 100 | $this->assertCriteria($criteriaSet, DescriptorTypeCriteria::class, 'getDescriptorType', SpSsoDescriptor::class); |
101 | 101 | $this->assertCriteria($criteriaSet, ServiceTypeCriteria::class, 'getServiceType', AssertionConsumerService::class); |
102 | 102 | $this->assertCriteria($criteriaSet, LocationCriteria::class, 'getLocation', $recipient); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $endpointResolver->expects($this->once()) |
132 | 132 | ->method('resolve') |
133 | - ->willReturnCallback(function () use ($recipient) { |
|
133 | + ->willReturnCallback(function() use ($recipient) { |
|
134 | 134 | return [$this->getEndpointReferenceMock(new AssertionConsumerService())]; |
135 | 135 | }); |
136 | 136 |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | $credentialResolverMock->method('query')->willReturn($query = new CredentialResolverQuery($credentialResolverMock)); |
94 | 94 | $credentialResolverMock->method('resolve') |
95 | - ->willReturnCallback(function (CriteriaSet $criteriaSet) use ($ownEntityId, $expectedMetadataType) { |
|
95 | + ->willReturnCallback(function(CriteriaSet $criteriaSet) use ($ownEntityId, $expectedMetadataType) { |
|
96 | 96 | $this->assertCriteria($criteriaSet, EntityIdCriteria::class, 'getEntityId', $ownEntityId); |
97 | 97 | $this->assertCriteria($criteriaSet, UsageCriteria::class, 'getUsage', UsageType::SIGNING); |
98 | 98 | $this->assertCriteria($criteriaSet, X509CredentialCriteria::class, null, null); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
153 | - * @param XMLSecurityKey|null $privateKey |
|
153 | + * @param XMLSecurityKey $privateKey |
|
154 | 154 | * |
155 | 155 | * @return AbstractCredential |
156 | 156 | */ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * @param XMLSecurityKey|null $publicKey |
|
165 | + * @param XMLSecurityKey $publicKey |
|
166 | 166 | * |
167 | 167 | * @return AbstractCredential |
168 | 168 | */ |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * @param array|string[] $names |
|
65 | + * @param string[] $names |
|
66 | 66 | * @param string|null $namespace |
67 | 67 | */ |
68 | 68 | protected function singleElementsToXml(array $names, \DOMNode $parent, SerializationContext $context, $namespace = null) |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * @param array|string[] $names |
|
168 | + * @param string[] $names |
|
169 | 169 | */ |
170 | 170 | protected function attributesToXml(array $names, \DOMElement $element) |
171 | 171 | { |