Skip to content

Commit b402857

Browse files
committed
The SecondFactor::getType method is now public
The SecondFactorCollection performs the comparison on the two SF's using the SFTService. The service expects to be called with SecondFactorType instances. To do so, the type has been exposed publicly.
1 parent e43b7c7 commit b402857

6 files changed

+10
-9
lines changed

src/Surfnet/Stepup/Identity/Entity/AbstractSecondFactor.php

-5
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,4 @@ public function hasTypeWithEqualOrLowerLoaComparedTo(SecondFactorType $type, Sec
3333
{
3434
return $service->hasEqualOrLowerLoaComparedTo($this->getType(), $type);
3535
}
36-
37-
/**
38-
* @return SecondFactorType
39-
*/
40-
abstract protected function getType();
4136
}

src/Surfnet/Stepup/Identity/Entity/SecondFactor.php

+6
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,10 @@ public function hasEqualOrHigherLoaComparedTo(SecondFactor $comparable, SecondFa
3636
* @return bool
3737
*/
3838
public function hasTypeWithEqualOrLowerLoaComparedTo(SecondFactorType $type, SecondFactorTypeService $service);
39+
40+
/**
41+
* @return SecondFactorType
42+
*/
43+
public function getType();
44+
3945
}

src/Surfnet/Stepup/Identity/Entity/SecondFactorCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getSecondFactorWithHighestLoa(SecondFactorTypeService $service)
3232
return array_reduce(
3333
$this->toArray(),
3434
function (SecondFactor $carry, SecondFactor $item) use ($service) {
35-
return $service->hasEqualOrHigherLoaComparedTo($carry, $item->getType()) ? $carry : $item;
35+
return $service->hasEqualOrHigherLoaComparedTo($carry->getType(), $item->getType()) ? $carry : $item;
3636
},
3737
$this->first() ?: null
3838
);

src/Surfnet/Stepup/Identity/Entity/UnverifiedSecondFactor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function applyIdentityForgottenEvent(IdentityForgottenEvent $event)
204204
$this->secondFactorIdentifier = $secondFactorIdentifierClass::unknown();
205205
}
206206

207-
protected function getType()
207+
public function getType()
208208
{
209209
return $this->type;
210210
}

src/Surfnet/Stepup/Identity/Entity/VerifiedSecondFactor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function applyIdentityForgottenEvent(IdentityForgottenEvent $event)
191191
$this->secondFactorIdentifier = $secondFactorIdentifierClass::unknown();
192192
}
193193

194-
protected function getType()
194+
public function getType()
195195
{
196196
return $this->type;
197197
}

src/Surfnet/Stepup/Identity/Entity/VettedSecondFactor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function applyIdentityForgottenEvent(IdentityForgottenEvent $event)
122122
$this->secondFactorIdentifier = $secondFactorIdentifierClass::unknown();
123123
}
124124

125-
protected function getType()
125+
public function getType()
126126
{
127127
return $this->type;
128128
}

0 commit comments

Comments
 (0)