@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | return new Mutator( |
56 | 56 | null, |
57 | 57 | fn($value, $ctx) => |
58 | - is_null($value) ? $value : |
|
59 | - ( |
|
58 | + is_null($value) ? $value : ( |
|
60 | 59 | Assert::value(intval($value))->gt(0)->get() |
61 | 60 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
62 | 61 | ) |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | return new Mutator( |
91 | 90 | null, |
92 | 91 | fn($value, $ctx) => |
93 | - is_null($value) ? $value : |
|
94 | - ( |
|
92 | + is_null($value) ? $value : ( |
|
95 | 93 | Assert::value(intval($value))->gt(0)->get() |
96 | 94 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
97 | 95 | ) |
@@ -125,8 +123,7 @@ discard block |
||
125 | 123 | return new Mutator( |
126 | 124 | null, |
127 | 125 | fn($value, $ctx) => |
128 | - is_null($value) ? $value : |
|
129 | - ( |
|
126 | + is_null($value) ? $value : ( |
|
130 | 127 | Assert::value(floatval($value))->gte(0)->get() |
131 | 128 | ?? $ctx->raise('inválido') |
132 | 129 | ) |
@@ -160,8 +157,7 @@ discard block |
||
160 | 157 | return new Mutator( |
161 | 158 | null, |
162 | 159 | fn($value, $ctx) => |
163 | - is_null($value) ? $value : |
|
164 | - ( |
|
160 | + is_null($value) ? $value : ( |
|
165 | 161 | Assert::value(floatval($value))->gte(0)->get() |
166 | 162 | ?? $ctx->raise('inválido') |
167 | 163 | ) |
@@ -195,8 +191,7 @@ discard block |
||
195 | 191 | return new Mutator( |
196 | 192 | null, |
197 | 193 | fn($value, $ctx) => |
198 | - is_null($value) ? $value : |
|
199 | - ( |
|
194 | + is_null($value) ? $value : ( |
|
200 | 195 | // Assert::value($value)->between(1, 12)->get() |
201 | 196 | Assert::value(floatval($value))->gte(0)->get() |
202 | 197 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | return new Mutator( |
52 | 52 | null, |
53 | 53 | fn($value, $ctx) => |
54 | - is_null($value) ? $value : |
|
55 | - ( |
|
54 | + is_null($value) ? $value : ( |
|
56 | 55 | Assert::value(floatval($value))->gte(0)->get() |
57 | 56 | ?? $ctx->raise('inválido') |
58 | 57 | ) |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | return new Mutator( |
65 | 64 | null, |
66 | 65 | fn($value, $ctx) => |
67 | - is_null($value) ? $value : |
|
68 | - ( |
|
66 | + is_null($value) ? $value : ( |
|
69 | 67 | Assert::value(floatval($value))->gte(0)->get() |
70 | 68 | ?? $ctx->raise('inválido') |
71 | 69 | ) |
@@ -77,8 +75,7 @@ discard block |
||
77 | 75 | return new Mutator( |
78 | 76 | null, |
79 | 77 | fn($value, $ctx) => |
80 | - is_null($value) ? $value : |
|
81 | - ( |
|
78 | + is_null($value) ? $value : ( |
|
82 | 79 | Assert::value(floatval($value))->gte(0)->get() |
83 | 80 | ?? $ctx->raise('inválido') |
84 | 81 | ) |
@@ -194,6 +194,6 @@ |
||
194 | 194 | |
195 | 195 | private function incrementRequestCounter(): int |
196 | 196 | { |
197 | - return ++self::$requestCounter; |
|
197 | + return++self::$requestCounter; |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | \ No newline at end of file |
@@ -128,21 +128,25 @@ |
||
128 | 128 | { |
129 | 129 | $responseData = $response->getParsedPath('message'); |
130 | 130 | |
131 | - if (is_string($responseData)) |
|
132 | - return [$responseData]; |
|
131 | + if (is_string($responseData)) { |
|
132 | + return [$responseData]; |
|
133 | + } |
|
133 | 134 | |
134 | - if (is_array($responseData)) |
|
135 | - return ArrayUtil::extractStrings($responseData); |
|
135 | + if (is_array($responseData)) { |
|
136 | + return ArrayUtil::extractStrings($responseData); |
|
137 | + } |
|
136 | 138 | |
137 | 139 | $responseData = $response->getParsedPath('error'); |
138 | 140 | |
139 | - if (is_array($responseData)) |
|
140 | - return ArrayUtil::extractStrings($responseData); |
|
141 | + if (is_array($responseData)) { |
|
142 | + return ArrayUtil::extractStrings($responseData); |
|
143 | + } |
|
141 | 144 | |
142 | 145 | $responseData = $response->getParsedPath('data'); |
143 | 146 | |
144 | - if (is_array($responseData)) |
|
145 | - return ArrayUtil::extractStrings($responseData); |
|
147 | + if (is_array($responseData)) { |
|
148 | + return ArrayUtil::extractStrings($responseData); |
|
149 | + } |
|
146 | 150 | } |
147 | 151 | |
148 | 152 | } |
149 | 153 | \ No newline at end of file |
@@ -13,8 +13,9 @@ |
||
13 | 13 | |
14 | 14 | public function __construct(string $environment) |
15 | 15 | { |
16 | - if (!$this->isValidEnv($environment)) |
|
17 | - throw new \UnexpectedValueException("The environment must be valid"); |
|
16 | + if (!$this->isValidEnv($environment)) { |
|
17 | + throw new \UnexpectedValueException("The environment must be valid"); |
|
18 | + } |
|
18 | 19 | |
19 | 20 | parent::__construct($environment); |
20 | 21 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @param array|null $filters |
58 | 58 | * @return Response |
59 | 59 | */ |
60 | - public function list(?array $filters = []): Response |
|
60 | + public function list(?array $filters = []) : Response |
|
61 | 61 | { |
62 | 62 | return $this->_GET($filters ?? []); |
63 | 63 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @param array|null $filters |
58 | 58 | * @return Response |
59 | 59 | */ |
60 | - public function list(?array $filters = []): Response |
|
60 | + public function list(?array $filters = []) : Response |
|
61 | 61 | { |
62 | 62 | return $this->_GET($filters ?? []); |
63 | 63 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @param array|null $filters |
58 | 58 | * @return Response |
59 | 59 | */ |
60 | - public function list(?array $filters = []): Response |
|
60 | + public function list(?array $filters = []) : Response |
|
61 | 61 | { |
62 | 62 | return $this->_GET($filters ?? []); |
63 | 63 | } |
@@ -47,8 +47,7 @@ |
||
47 | 47 | return new Mutator( |
48 | 48 | null, |
49 | 49 | fn($value, $ctx) => |
50 | - is_null($value) ? $value : |
|
51 | - ( |
|
50 | + is_null($value) ? $value : ( |
|
52 | 51 | Assert::value(floatval($value))->gte(0)->get() |
53 | 52 | ?? $ctx->raise('inválido') |
54 | 53 | ) |