@@ -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 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $value = $this->getValueByKey($this->response, $key); |
| 27 | 27 | |
| 28 | - if(!is_string($value) || \isEmptyOrNull($value)) { |
|
| 28 | + if (!is_string($value) || \isEmptyOrNull($value)) { |
|
| 29 | 29 | $value = ''; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $value = (bool) $this->getValueByKey($this->response, $key); |
| 38 | 38 | |
| 39 | - if(!is_bool($value) || \isEmptyOrNull($value)) { |
|
| 39 | + if (!is_bool($value) || \isEmptyOrNull($value)) { |
|
| 40 | 40 | $value = false; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | $value = (int) $this->getValueByKey($this->response, $key); |
| 49 | 49 | |
| 50 | - if(!is_int($value) || \isEmptyOrNull($value)) { |
|
| 50 | + if (!is_int($value) || \isEmptyOrNull($value)) { |
|
| 51 | 51 | $value = 0; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -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); |