Code Duplication    Length = 3-3 lines in 2 locations

src/u2flib_server/U2F.php 2 locations

@@ 146-148 (lines=3) @@
143
            throw new \InvalidArgumentException('$response of doRegister() method only accepts object.');
144
        }
145
146
        if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) {
147
            throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING );
148
        }
149
150
        if( !is_bool( $includeCert ) ) {
151
            throw new \InvalidArgumentException('$include_cert of doRegister() method only accepts boolean.');
@@ 261-263 (lines=3) @@
258
            throw new \InvalidArgumentException('$response of doAuthenticate() method only accepts object.');
259
        }
260
261
        if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) {
262
            throw new Error('User-agent returned error. Error code: ' . $response->errorCode, ERR_BAD_UA_RETURNING );
263
        }
264
265
        /** @var object|null $req */
266
        $req = null;