Skip to content

Commit 3220aab

Browse files
committed
Lint
1 parent fc8441a commit 3220aab

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/ValueAbstracts/SignatureKeyPairBag.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public function hasKeyId(string $keyId): bool
5454

5555
public function getFirst(): ?SignatureKeyPair
5656
{
57-
return $this->signatureKeyPairs[array_key_first($this->signatureKeyPairs)] ?? null;
57+
if (is_null($firstKey = array_key_first($this->signatureKeyPairs))) {
58+
return null;
59+
}
60+
61+
return $this->signatureKeyPairs[$firstKey] ?? null;
5862
}
5963

6064

src/ValueAbstracts/SignatureKeyPairConfigBag.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public function getAllAlgorithmNamesUnique(): array
6969

7070
public function getFirst(): ?SignatureKeyPairConfig
7171
{
72-
return $this->signatureKeyPairConfigs[array_key_first($this->signatureKeyPairConfigs)] ?? null;
72+
if (is_null($firstKey = array_key_first($this->signatureKeyPairConfigs))) {
73+
return null;
74+
}
75+
76+
return $this->signatureKeyPairConfigs[$firstKey] ?? null;
7377
}
7478

7579

0 commit comments

Comments
 (0)