@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | public function enableGlobalPreflight(ApiHandlerInterface $corsHandler = null) |
48 | 48 | { |
49 | - if (!$corsHandler) { |
|
49 | + if ( ! $corsHandler) { |
|
50 | 50 | $corsHandler = new CorsPreflightHandler(new Response()); |
51 | 51 | } |
52 | 52 | $this->globalPreflightHandler = $corsHandler; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $versionHandlers = []; |
41 | 41 | foreach ($handlers as $handler) { |
42 | 42 | $endPoint = $handler->getEndpoint(); |
43 | - if (!isset($versionHandlers[$endPoint->getVersion()])) { |
|
43 | + if ( ! isset($versionHandlers[$endPoint->getVersion()])) { |
|
44 | 44 | $versionHandlers[$endPoint->getVersion()] = []; |
45 | 45 | } |
46 | 46 | $versionHandlers[$endPoint->getVersion()][] = $handler; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | public function getValue() |
10 | 10 | { |
11 | - if (!filter_has_var(INPUT_GET, $this->key) && isset($_GET[$this->key])) { |
|
11 | + if ( ! filter_has_var(INPUT_GET, $this->key) && isset($_GET[$this->key])) { |
|
12 | 12 | return $_GET[$this->key]; |
13 | 13 | } |
14 | 14 | $value = $this->isMulti() ? filter_input(INPUT_GET, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_GET, $this->key); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | public function getValue() |
10 | 10 | { |
11 | - if (!filter_has_var(INPUT_POST, $this->key) && isset($_POST[$this->key])) { |
|
11 | + if ( ! filter_has_var(INPUT_POST, $this->key) && isset($_POST[$this->key])) { |
|
12 | 12 | return $_POST[$this->key]; |
13 | 13 | } |
14 | 14 | $value = $this->isMulti() ? filter_input(INPUT_POST, $this->key, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY) : filter_input(INPUT_POST, $this->key); |
@@ -143,7 +143,7 @@ |
||
143 | 143 | |
144 | 144 | public function updateConsoleForm(Form $form): void |
145 | 145 | { |
146 | - $count = $this->isMulti() ? 5 : 1; // TODO moznost nastavit kolko inputov sa ma vygenerovat v konzole, default moze byt 5 |
|
146 | + $count = $this->isMulti() ? 5 : 1; // TODO moznost nastavit kolko inputov sa ma vygenerovat v konzole, default moze byt 5 |
|
147 | 147 | for ($i = 0; $i < $count; $i++) { |
148 | 148 | $key = $this->getKey(); |
149 | 149 | if ($this->isMulti()) { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | public function getValue() |
10 | 10 | { |
11 | - if (!filter_has_var(INPUT_COOKIE, $this->key) && isset($_COOKIE[$this->key])) { |
|
11 | + if ( ! filter_has_var(INPUT_COOKIE, $this->key) && isset($_COOKIE[$this->key])) { |
|
12 | 12 | return $_COOKIE[$this->key]; |
13 | 13 | } |
14 | 14 | $value = filter_input(INPUT_COOKIE, $this->key); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | protected function getFractal(): Manager |
76 | 76 | { |
77 | - if (!$this->fractal) { |
|
77 | + if ( ! $this->fractal) { |
|
78 | 78 | throw new InvalidStateException("Fractal manager isn't initialized. Did you call parent::__construct() in your handler constructor?"); |
79 | 79 | } |
80 | 80 | return $this->fractal; |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | */ |
117 | 117 | final public function createLink(array $params = []): string |
118 | 118 | { |
119 | - if (!$this->linkGenerator) { |
|
119 | + if ( ! $this->linkGenerator) { |
|
120 | 120 | throw new InvalidStateException("You have setupLinkGenerator for this handler if you want to generate link in this handler"); |
121 | 121 | } |
122 | - if (!$this->endpoint) { |
|
122 | + if ( ! $this->endpoint) { |
|
123 | 123 | throw new InvalidStateException("You have setEndpoint() for this handler if you want to generate link in this handler"); |
124 | 124 | } |
125 | 125 | $params = array_merge([ |
@@ -9,11 +9,11 @@ |
||
9 | 9 | */ |
10 | 10 | public function getRequestIp(): string |
11 | 11 | { |
12 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
12 | + if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
13 | 13 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
14 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '127.0.0.1') { |
|
14 | + } elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '127.0.0.1') { |
|
15 | 15 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
16 | - } elseif (!empty($_SERVER['REMOTE_ADDR'])) { |
|
16 | + } elseif ( ! empty($_SERVER['REMOTE_ADDR'])) { |
|
17 | 17 | $ip = $_SERVER['REMOTE_ADDR']; |
18 | 18 | } else { |
19 | 19 | $ip = 'cli'; |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function getApiList(int $version): array |
55 | 55 | { |
56 | - $versionApis = array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) { |
|
56 | + $versionApis = array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) { |
|
57 | 57 | return $version === $api->getEndpoint()->getVersion(); |
58 | 58 | }); |
59 | 59 | |
60 | - return array_map(function (Api $api) { |
|
60 | + return array_map(function(Api $api) { |
|
61 | 61 | return [ |
62 | 62 | 'method' => $api->getEndpoint()->getMethod(), |
63 | 63 | 'version' => $api->getEndpoint()->getVersion(), |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function createParamsList(ApiHandlerInterface $handler): array |
81 | 81 | { |
82 | - return array_map(function (InputParam $param) { |
|
82 | + return array_map(function(InputParam $param) { |
|
83 | 83 | $parameter = [ |
84 | 84 | 'type' => $param->getType(), |
85 | 85 | 'key' => $param->getKey(), |