File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments