@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!function_exists('isEmptyOrNull')) { |
|
| 3 | +if (!function_exists('isEmptyOrNull')) { |
|
| 4 | 4 | function isEmptyOrNull($value): bool |
| 5 | 5 | { |
| 6 | 6 | return is_null($value) || empty($value) || '' === $value; |
| 7 | 7 | } |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -if(!function_exists('base64URLEncode')) { |
|
| 10 | +if (!function_exists('base64URLEncode')) { |
|
| 11 | 11 | /** |
| 12 | 12 | * base64URLEncode |
| 13 | 13 | * |
@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if(!function_exists('createVerifier')) { |
|
| 34 | +if (!function_exists('createVerifier')) { |
|
| 35 | 35 | function createVerifier(): string |
| 36 | 36 | { |
| 37 | - $random = bin2hex( openssl_random_pseudo_bytes(32) ); |
|
| 37 | + $random = bin2hex(openssl_random_pseudo_bytes(32)); |
|
| 38 | 38 | |
| 39 | - return \base64URLEncode( pack('H*', $random) ); |
|
| 39 | + return \base64URLEncode(pack('H*', $random)); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -if(!function_exists('createChallenge')) { |
|
| 43 | +if (!function_exists('createChallenge')) { |
|
| 44 | 44 | function createChallenge(string $verifier): string |
| 45 | 45 | { |
| 46 | - return \base64URLEncode( pack('H*', hash('sha256', $verifier) ) ); |
|
| 46 | + return \base64URLEncode(pack('H*', hash('sha256', $verifier))); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | protected $code_challenge_method; |
| 28 | 28 | |
| 29 | - public function __construct(array $options = [ ], array $collaborators = [ ]) |
|
| 29 | + public function __construct(array $options = [], array $collaborators = []) |
|
| 30 | 30 | { |
| 31 | 31 | $options['code_challenge_method'] = 'S256'; |
| 32 | 32 | parent::__construct($options, $collaborators); |