Code Duplication    Length = 11-11 lines in 2 locations

src/Surfnet/StepupRa/RaBundle/Service/U2fService.php 2 locations

@@ 90-100 (lines=11) @@
87
            && is_array($result['errors'])
88
            && $result['errors'] === array_filter($result['errors'], 'is_string');
89
90
        if ($hasErrors && $statusCode >= 400 && $statusCode < 600) {
91
            $this->logger->critical(
92
                sprintf(
93
                    'U2F sign request creation failed; HTTP %d with errors "%s"',
94
                    $statusCode,
95
                    join(', ', $result['errors'])
96
                )
97
            );
98
99
            return SignRequestCreationResult::apiError();
100
        }
101
102
        $actualKeys = array_keys($result);
103
        $expectedKeys = ['app_id', 'challenge', 'key_handle', 'version'];
@@ 181-191 (lines=11) @@
178
            && is_array($result['errors'])
179
            && $result['errors'] === array_filter($result['errors'], 'is_string');
180
181
        if ($hasErrors && $statusCode >= 400 && $statusCode < 600) {
182
            $this->logger->critical(
183
                sprintf(
184
                    'U2F authentication verification failed; HTTP %d with errors "%s"',
185
                    $statusCode,
186
                    join(', ', $result['errors'])
187
                )
188
            );
189
190
            return AuthenticationVerificationResult::apiError();
191
        }
192
193
        $hasStatus = isset($result['status']) && is_string($result['status']);
194