File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -546,16 +546,22 @@ private function normalizeIdentifyMethods(array $signer): array {
546546 $ normalizedMethods = [];
547547
548548 foreach ($ signer [$ key ] as $ name => $ data ) {
549- if ($ key === 'identifyMethods ' ) {
550- $ normalizedMethods [] = $ this ->normalizeIdentifyMethodsStructure ($ data );
551- } else {
552- $ normalizedMethods [] = $ this ->normalizeIdentifyStructure ($ name , $ data );
553- }
549+ $ normalizedMethods [] = $ this ->normalizeIdentifyMethodEntry ($ key , $ name , $ data );
554550 }
555-
556551 return $ normalizedMethods ;
557552 }
558553
554+ /**
555+ * Extracted from normalizeIdentifyMethods to reduce cyclomatic complexity.
556+ */
557+ private function normalizeIdentifyMethodEntry (string $ key , $ name , $ data ): array {
558+ if ($ key === 'identifyMethods ' ) {
559+ return $ this ->normalizeIdentifyMethodsStructure ($ data );
560+ } else {
561+ return $ this ->normalizeIdentifyStructure ($ name , $ data );
562+ }
563+ }
564+
559565 private function normalizeIdentifyMethodsStructure (mixed $ data ): array {
560566 if (!is_array ($ data ) || !array_key_exists ('method ' , $ data ) || !array_key_exists ('value ' , $ data )) {
561567 throw new LibresignException ('Invalid identify method structure ' );
You can’t perform that action at this time.
0 commit comments