mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Added code coverage ignore docblocks
This commit is contained in:
parent
de13e14cdd
commit
335630f150
@ -36,7 +36,9 @@ class KeyCrypt
|
||||
$chunk = substr($unencryptedData, 0, $chunkSize);
|
||||
$unencryptedData = substr($unencryptedData, $chunkSize);
|
||||
if (openssl_private_encrypt($chunk, $encrypted, $privateKey) === false) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \LogicException('Failed to encrypt data');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$output .= $encrypted;
|
||||
}
|
||||
@ -72,7 +74,9 @@ class KeyCrypt
|
||||
$chunk = substr($encryptedData, 0, $chunkSize);
|
||||
$encryptedData = substr($encryptedData, $chunkSize);
|
||||
if (openssl_public_decrypt($chunk, $decrypted, $publicKey) === false) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \LogicException('Failed to decrypt data');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$output .= $decrypted;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ class SecureKey
|
||||
{
|
||||
try {
|
||||
$string = random_bytes($len);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (\TypeError $e) {
|
||||
// Well, it's an integer, so this IS unexpected.
|
||||
throw OAuthServerException::serverError("An unexpected error has occurred");
|
||||
@ -41,6 +42,7 @@ class SecureKey
|
||||
// If you get this message, the CSPRNG failed hard.
|
||||
throw OAuthServerException::serverError("Could not generate a random string. Is our OS secure?");
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return bin2hex($string);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user