@@ -84,7 +84,7 @@ |
||
| 84 | 84 | protected function init(Container $container) |
| 85 | 85 | { |
| 86 | 86 | $this->config = $container->getService(\App\Config::class); |
| 87 | - $this->configParams = $this->config->getSettings( |
|
| 87 | + $this->configParams = $this->config->getSettings( |
|
| 88 | 88 | Config::_MIDDLEWARES |
| 89 | 89 | )[get_called_class()]; |
| 90 | 90 | $this->request = $container->getService(\App\Http\Request::class); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | public function getRaw(): array |
| 84 | 84 | { |
| 85 | 85 | return array_map( |
| 86 | - function ($key, $val) { |
|
| 86 | + function($key, $val) { |
|
| 87 | 87 | return $key . ': ' . $val; |
| 88 | 88 | }, |
| 89 | 89 | array_keys($this->headers), |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | class Middleware |
| 19 | 19 | { |
| 20 | 20 | |
| 21 | - protected static $excMsg = ' is not a valid onion layer.'; |
|
| 21 | + protected static $excMsg = ' is not a valid onion layer.'; |
|
| 22 | 22 | protected $layers; |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $layers = array_reverse($this->layers); |
| 68 | 68 | $completeMiddleware = array_reduce( |
| 69 | 69 | $layers, |
| 70 | - function ($nextLayer, $layer) { |
|
| 70 | + function($nextLayer, $layer) { |
|
| 71 | 71 | return $this->createLayer($nextLayer, $layer); |
| 72 | 72 | }, |
| 73 | 73 | $coreFunction |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | protected function createCoreFunction(Closure $core): Closure |
| 97 | 97 | { |
| 98 | - return function ($object) use ($core) { |
|
| 98 | + return function($object) use ($core) { |
|
| 99 | 99 | return $core($object); |
| 100 | 100 | }; |
| 101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function createLayer(Closure $nextLayer, ILayer $layer): Closure |
| 112 | 112 | { |
| 113 | - return function ($object) use ($nextLayer, $layer) { |
|
| 113 | + return function($object) use ($nextLayer, $layer) { |
|
| 114 | 114 | return $layer->peel($object, $nextLayer); |
| 115 | 115 | }; |
| 116 | 116 | } |
@@ -345,7 +345,7 @@ |
||
| 345 | 345 | } elseif ($this->method === self::METHOD_TRACE) { |
| 346 | 346 | $this->params = $this->getCliParams(); |
| 347 | 347 | } else { |
| 348 | - $this->params = $this->getInput(); |
|
| 348 | + $this->params = $this->getInput(); |
|
| 349 | 349 | } |
| 350 | 350 | return $this; |
| 351 | 351 | } |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | const HTTP_CONTINUE = 100; |
| 8 | 8 | const HTTP_SWITCHING_PROTOCOLS = 101; |
| 9 | - const HTTP_PROCESSING = 102; // RFC2518 |
|
| 10 | - const HTTP_EARLY_HINTS = 103; // RFC8297 |
|
| 9 | + const HTTP_PROCESSING = 102; // RFC2518 |
|
| 10 | + const HTTP_EARLY_HINTS = 103; // RFC8297 |
|
| 11 | 11 | const HTTP_OK = 200; |
| 12 | 12 | const HTTP_CREATED = 201; |
| 13 | 13 | const HTTP_ACCEPTED = 202; |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | const HTTP_NO_CONTENT = 204; |
| 16 | 16 | const HTTP_RESET_CONTENT = 205; |
| 17 | 17 | const HTTP_PARTIAL_CONTENT = 206; |
| 18 | - const HTTP_MULTI_STATUS = 207; // RFC4918 |
|
| 19 | - const HTTP_ALREADY_REPORTED = 208; // RFC5842 |
|
| 20 | - const HTTP_IM_USED = 226; // RFC3229 |
|
| 18 | + const HTTP_MULTI_STATUS = 207; // RFC4918 |
|
| 19 | + const HTTP_ALREADY_REPORTED = 208; // RFC5842 |
|
| 20 | + const HTTP_IM_USED = 226; // RFC3229 |
|
| 21 | 21 | const HTTP_MULTIPLE_CHOICES = 300; |
| 22 | 22 | const HTTP_MOVED_PERMANENTLY = 301; |
| 23 | 23 | const HTTP_FOUND = 302; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | const HTTP_USE_PROXY = 305; |
| 27 | 27 | const HTTP_RESERVED = 306; |
| 28 | 28 | const HTTP_TEMPORARY_REDIRECT = 307; |
| 29 | - const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 |
|
| 29 | + const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 |
|
| 30 | 30 | const HTTP_BAD_REQUEST = 400; |
| 31 | 31 | const HTTP_UNAUTHORIZED = 401; |
| 32 | 32 | const HTTP_PAYMENT_REQUIRED = 402; |
@@ -45,16 +45,16 @@ discard block |
||
| 45 | 45 | const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; |
| 46 | 46 | const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; |
| 47 | 47 | const HTTP_EXPECTATION_FAILED = 417; |
| 48 | - const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 |
|
| 49 | - const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 |
|
| 50 | - const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 |
|
| 51 | - const HTTP_LOCKED = 423; // RFC4918 |
|
| 52 | - const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 |
|
| 53 | - const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 |
|
| 54 | - const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 |
|
| 55 | - const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 |
|
| 56 | - const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 |
|
| 57 | - const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 |
|
| 48 | + const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 |
|
| 49 | + const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 |
|
| 50 | + const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 |
|
| 51 | + const HTTP_LOCKED = 423; // RFC4918 |
|
| 52 | + const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 |
|
| 53 | + const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 |
|
| 54 | + const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 |
|
| 55 | + const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 |
|
| 56 | + const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 |
|
| 57 | + const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 |
|
| 58 | 58 | const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; |
| 59 | 59 | const HTTP_INTERNAL_SERVER_ERROR = 500; |
| 60 | 60 | const HTTP_NOT_IMPLEMENTED = 501; |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | const HTTP_SERVICE_UNAVAILABLE = 503; |
| 63 | 63 | const HTTP_GATEWAY_TIMEOUT = 504; |
| 64 | 64 | const HTTP_VERSION_NOT_SUPPORTED = 505; |
| 65 | - const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 |
|
| 66 | - const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 |
|
| 67 | - const HTTP_LOOP_DETECTED = 508; // RFC5842 |
|
| 68 | - const HTTP_NOT_EXTENDED = 510; // RFC2774 |
|
| 69 | - const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 |
|
| 65 | + const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 |
|
| 66 | + const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 |
|
| 67 | + const HTTP_LOOP_DETECTED = 508; // RFC5842 |
|
| 68 | + const HTTP_NOT_EXTENDED = 510; // RFC2774 |
|
| 69 | + const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 |
|
| 70 | 70 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | openssl_random_pseudo_bytes(self::_RANDOM_BYTES_LEN) |
| 130 | 130 | ); |
| 131 | 131 | $issuedAt = time() - 100; |
| 132 | - $notBefore = $issuedAt + $this->issueAtDelay; //Adding 10 seconds |
|
| 132 | + $notBefore = $issuedAt + $this->issueAtDelay; //Adding 10 seconds |
|
| 133 | 133 | $expire = $notBefore + $this->ttl; // Adding 60 seconds |
| 134 | 134 | $serverName = $this->request->getHost(); |
| 135 | 135 | return [ |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | self::_ISS => $serverName, // Issuer |
| 139 | 139 | self::_NBF => $notBefore, // Not before |
| 140 | 140 | self::_EXP => $expire, // Expire |
| 141 | - self::_DATA => [ // Data related to the signer user |
|
| 141 | + self::_DATA => [// Data related to the signer user |
|
| 142 | 142 | self::_DATA_ID => $uid, // userid from the users table |
| 143 | 143 | self::_DATA_LOGIN => $login, // User name |
| 144 | 144 | self::_DATA_PASSWORD_HASH => password_hash($password, PASSWORD_DEFAULT), |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | { |
| 160 | 160 | if ($this->constructable($serviceName)) { |
| 161 | 161 | if (!$this->hasService($serviceName)) { |
| 162 | - $args = array_map(function ($value) { |
|
| 162 | + $args = array_map(function($value) { |
|
| 163 | 163 | if (is_array($value)) { |
| 164 | 164 | $values = []; |
| 165 | 165 | foreach ($value as $i) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | return realpath( |
| 70 | 70 | $this->config->getPath() . self::PATH_ASSETS_MODEL |
| 71 | - ) . self::ACCOUNTS_FILENAME; |
|
| 71 | + ) . self::ACCOUNTS_FILENAME; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if (!file_exists($filename)) { |
| 102 | 102 | $crypt = new Crypt($this->config); |
| 103 | 103 | $accounts = $this->config->getSettings(Config::_ACCOUNTS); |
| 104 | - $accounts = array_map(function ($ac) use ($crypt) { |
|
| 104 | + $accounts = array_map(function($ac) use ($crypt) { |
|
| 105 | 105 | $ac[self::_PASSWORD] = $crypt->encrypt( |
| 106 | 106 | $ac[self::_PASSWORD], |
| 107 | 107 | true |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | (new Middleware())->layer($this->middlewares)->peel( |
| 250 | 250 | $this->container, |
| 251 | - function ($container) { |
|
| 251 | + function($container) { |
|
| 252 | 252 | $this->execute(null); |
| 253 | 253 | return $container; |
| 254 | 254 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | protected function setActions() |
| 363 | 363 | { |
| 364 | 364 | $methods = $this->getFinalMethods(); |
| 365 | - $methodsName = array_map(function ($method) { |
|
| 365 | + $methodsName = array_map(function($method) { |
|
| 366 | 366 | return $method->name; |
| 367 | 367 | }, $methods); |
| 368 | 368 | $this->actions = array_merge($methodsName, [Kernel::_PREFLIGHT]); |