@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function apiKeyGenerate($length = 32) |
37 | 37 | { |
38 | - $randInt = microtime().rand(1000, 9999); |
|
38 | + $randInt = microtime() . rand(1000, 9999); |
|
39 | 39 | $messageDigest = md5($randInt); |
40 | 40 | return implode( |
41 | 41 | '-', |
@@ -215,7 +215,7 @@ |
||
215 | 215 | if ($nLeakRate < 0) { |
216 | 216 | $nLeakRate = 0; |
217 | 217 | } |
218 | - $this->leakage = (float)$nLeakRate; |
|
218 | + $this->leakage = (float) $nLeakRate; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 |
@@ -138,7 +138,7 @@ |
||
138 | 138 | |
139 | 139 | if (is_numeric($timeframe)) { |
140 | 140 | if ($timeframe < 0) { |
141 | - $timeframe = ($timeframe*-1); |
|
141 | + $timeframe = ($timeframe * -1); |
|
142 | 142 | } |
143 | 143 | self::$timeframe['CUSTOM'] = $timeframe; |
144 | 144 | $this->window = intval(self::$timeframe['CUSTOM']); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public static function payload(array $payloadObject = []) |
68 | 68 | { |
69 | - if( self::isAnonymousScope($payloadObject) ) { |
|
69 | + if (self::isAnonymousScope($payloadObject)) { |
|
70 | 70 | return true; |
71 | 71 | } |
72 | 72 |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $bucket->getTokenData() |
212 | 212 | ); |
213 | 213 | |
214 | - if($this->isMockTest) { |
|
214 | + if ($this->isMockTest) { |
|
215 | 215 | return; |
216 | 216 | } |
217 | 217 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function getAccount() |
259 | 259 | { |
260 | - if($this->isMockTest) { |
|
260 | + if ($this->isMockTest) { |
|
261 | 261 | $this->getMockAccount(); |
262 | 262 | } |
263 | 263 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | $mockAccount = []; |
283 | 283 | |
284 | - if(!isset($mockAccount['bucket'])) { |
|
284 | + if (!isset($mockAccount['bucket'])) { |
|
285 | 285 | $mockAccount['bucket'] = $packer->pack( |
286 | 286 | $bucket->getTokenData() |
287 | 287 | ); |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | |
290 | 290 | $mockAccount['access'] = time(); |
291 | 291 | |
292 | - $this->setAccount((object)$mockAccount); |
|
293 | - $this->mockAccount = (object)$mockAccount; |
|
292 | + $this->setAccount((object) $mockAccount); |
|
293 | + $this->mockAccount = (object) $mockAccount; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $payloadObject = $cipher->jsonDecode($cipher->decode($jwtPayload)); |
52 | 52 | |
53 | 53 | // @codeCoverageIgnoreStart |
54 | - if( $this->key == 'payloadOnly' ) { |
|
54 | + if ($this->key == 'payloadOnly') { |
|
55 | 55 | return $payloadObject; |
56 | 56 | } |
57 | 57 | // @codeCoverageIgnoreEnd |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * @var array |
53 | 53 | */ |
54 | 54 | protected static $ALGORITHMS = [ |
55 | - 'HS256','sha256', |
|
56 | - 'HS384','sha384', |
|
57 | - 'HS512','sha512', |
|
55 | + 'HS256', 'sha256', |
|
56 | + 'HS384', 'sha384', |
|
57 | + 'HS512', 'sha512', |
|
58 | 58 | ]; |
59 | 59 | |
60 | 60 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * [getOptions] |
253 | 253 | * @return array |
254 | 254 | */ |
255 | - public function getOptions():?array |
|
255 | + public function getOptions(): ?array |
|
256 | 256 | { |
257 | 257 | return self::$options; |
258 | 258 | } |
@@ -156,8 +156,8 @@ |
||
156 | 156 | public static function getRequestVerb():string |
157 | 157 | { |
158 | 158 | $helper = new helper; |
159 | - $method = $helper->checkVal(@$_SERVER, 'REQUEST_METHOD', '' ); |
|
160 | - $method = $helper->checkVal(@$_SERVER, 'HTTP_X_HTTP_METHOD', $method ); |
|
159 | + $method = $helper->checkVal(@$_SERVER, 'REQUEST_METHOD', ''); |
|
160 | + $method = $helper->checkVal(@$_SERVER, 'HTTP_X_HTTP_METHOD', $method); |
|
161 | 161 | |
162 | 162 | return strtolower($method); |
163 | 163 | } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | |
158 | 158 | $headers = new headers\header; |
159 | 159 | $headers->setOptions($options); |
160 | - $headers->setHeaders($corsAllowed&&$isCorsRequest); |
|
160 | + $headers->setHeaders($corsAllowed && $isCorsRequest); |
|
161 | 161 | |
162 | 162 | http_response_code($this->ERROR_STATE['ERROR_CODE']); |
163 | 163 |