@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @property string $serviceName |
19 | 19 | * @property \chillerlan\OAuth\Storage\OAuthStorageInterface $storage |
20 | 20 | */ |
21 | -trait OAuth2CSRFTokenTrait{ |
|
21 | +trait OAuth2CSRFTokenTrait { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @param string|null $state |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | */ |
29 | 29 | protected function checkState(string $state = null):void{ |
30 | 30 | |
31 | - if(empty($state) || !$this->storage->hasCSRFState($this->serviceName)){ |
|
31 | + if (empty($state) || !$this->storage->hasCSRFState($this->serviceName)) { |
|
32 | 32 | throw new ProviderException('invalid state for '.$this->serviceName); |
33 | 33 | } |
34 | 34 | |
35 | 35 | $knownState = $this->storage->getCSRFState($this->serviceName); |
36 | 36 | |
37 | - if(!hash_equals($knownState, $state)){ |
|
37 | + if (!hash_equals($knownState, $state)) { |
|
38 | 38 | throw new ProviderException('invalid CSRF state: '.$this->serviceName.' '.$state); |
39 | 39 | } |
40 | 40 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | protected function setState(array $params):array{ |
49 | 49 | |
50 | - if(!isset($params['state'])){ |
|
50 | + if (!isset($params['state'])) { |
|
51 | 51 | $params['state'] = sha1(random_bytes(256)); |
52 | 52 | } |
53 | 53 |