@@ -43,10 +43,9 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | $found = |
46 | - array_search |
|
47 | - ( |
|
46 | + array_search( |
|
48 | 47 | $state, |
49 | - array_map(function ($v) { |
|
48 | + array_map(function($v) { |
|
50 | 49 | return strtoupper(self::sanitizeString($v)); |
51 | 50 | }, self::$states) |
52 | 51 | ); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public static function extractStrings(array $data): array |
49 | 49 | { |
50 | - return array_reduce($data, function ($strings, $value) { |
|
50 | + return array_reduce($data, function($strings, $value) { |
|
51 | 51 | if (is_array($value)) { |
52 | 52 | return array_merge($strings, self::extractStrings($value)); |
53 | 53 | } elseif (is_string($value) && !is_numeric($value)) { |
@@ -30,10 +30,8 @@ |
||
30 | 30 | return new Mutator( |
31 | 31 | null, |
32 | 32 | fn($value, $ctx) => |
33 | - is_null($value) ? $value : |
|
34 | - ( |
|
35 | - Assert::value($value)->array() ? $value : |
|
36 | - $ctx->raise('inválido (informe um array de actions de webhook)') |
|
33 | + is_null($value) ? $value : ( |
|
34 | + Assert::value($value)->array() ? $value : $ctx->raise('inválido (informe um array de actions de webhook)') |
|
37 | 35 | ) |
38 | 36 | ); |
39 | 37 | } |
@@ -76,8 +76,7 @@ discard block |
||
76 | 76 | return new Mutator( |
77 | 77 | null, |
78 | 78 | fn($value, $ctx) => |
79 | - is_null($value) ? $value : |
|
80 | - ( |
|
79 | + is_null($value) ? $value : ( |
|
81 | 80 | Assert::value($value)->asDigits()->lbetween(2, 2)->or()->lbetween(4, 4)->get() ?? $ctx->raise('inválido (informe um valor numérico de 2 ou 4 dígitos)') |
82 | 81 | ) |
83 | 82 | ); |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | return new Mutator( |
89 | 88 | null, |
90 | 89 | fn($value, $ctx) => |
91 | - is_null($value) ? $value : |
|
92 | - ( |
|
90 | + is_null($value) ? $value : ( |
|
93 | 91 | Assert::value($value)->asDigits()->lbetween(3, 3)->or()->lbetween(4, 4)->get() ?? $ctx->raise('inválido (informe um valor numérico de 3 ou 4 dígitos)') |
94 | 92 | ) |
95 | 93 | ); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | return $this->set(SchemaRelationAttribute::from($this, $attribute, $class)->many()); |
67 | 67 | } |
68 | 68 | |
69 | - public function array(string $attribute, ?SchemaAttribute $schema = null): SchemaArrayAttribute |
|
69 | + public function array(string $attribute, ?SchemaAttribute $schema = null) : SchemaArrayAttribute |
|
70 | 70 | { |
71 | 71 | return $this->set(SchemaArrayAttribute::from($this, $attribute, $schema)); |
72 | 72 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | { |
49 | 49 | $relationClass = $this->getRelationClass(); |
50 | 50 | |
51 | - return function ($e) use ($relationClass) { |
|
51 | + return function($e) use ($relationClass) { |
|
52 | 52 | if ($e instanceof $relationClass) { |
53 | 53 | return $e; |
54 | 54 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | return new Mutator( |
47 | 47 | null, |
48 | 48 | fn($value, $ctx) => |
49 | - is_null($value) ? $value : |
|
50 | - ( |
|
49 | + is_null($value) ? $value : ( |
|
51 | 50 | Assert::value(floatval($value))->gte(0)->get() |
52 | 51 | ?? $ctx->raise('inválido') |
53 | 52 | ) |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | return new Mutator( |
60 | 59 | null, |
61 | 60 | fn($value, $ctx) => |
62 | - is_null($value) ? $value : |
|
63 | - ( |
|
61 | + is_null($value) ? $value : ( |
|
64 | 62 | Assert::value(intval($value))->gt(0)->get() |
65 | 63 | ?? $ctx->raise('inválido') |
66 | 64 | ) |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | return new Mutator( |
45 | 45 | null, |
46 | 46 | fn($value, $ctx) => |
47 | - is_null($value) ? $value : |
|
48 | - ( |
|
47 | + is_null($value) ? $value : ( |
|
49 | 48 | Assert::value(floatval($value))->gte(0)->get() |
50 | 49 | ?? $ctx->raise('inválido') |
51 | 50 | ) |
@@ -57,8 +56,7 @@ discard block |
||
57 | 56 | return new Mutator( |
58 | 57 | null, |
59 | 58 | fn($value, $ctx) => |
60 | - is_null($value) ? $value : |
|
61 | - ( |
|
59 | + is_null($value) ? $value : ( |
|
62 | 60 | Assert::value(floatval($value))->gte(0)->get() |
63 | 61 | ?? $ctx->raise('inválido') |
64 | 62 | ) |
@@ -48,8 +48,7 @@ discard block |
||
48 | 48 | return new Mutator( |
49 | 49 | null, |
50 | 50 | fn($value, $ctx) => |
51 | - is_null($value) ? $value : |
|
52 | - ( |
|
51 | + is_null($value) ? $value : ( |
|
53 | 52 | Assert::value(intval($value))->gt(0)->get() |
54 | 53 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
55 | 54 | ) |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | return new Mutator( |
62 | 61 | null, |
63 | 62 | fn($value, $ctx) => |
64 | - is_null($value) ? $value : |
|
65 | - ( |
|
63 | + is_null($value) ? $value : ( |
|
66 | 64 | Assert::value(floatval($value))->gte(0)->get() |
67 | 65 | ?? $ctx->raise('inválido') |
68 | 66 | ) |
@@ -74,8 +72,7 @@ discard block |
||
74 | 72 | return new Mutator( |
75 | 73 | null, |
76 | 74 | fn($value, $ctx) => |
77 | - is_null($value) ? $value : |
|
78 | - ( |
|
75 | + is_null($value) ? $value : ( |
|
79 | 76 | Assert::value(floatval($value))->gte(0)->get() |
80 | 77 | ?? $ctx->raise('inválido') |
81 | 78 | ) |
@@ -87,8 +84,7 @@ discard block |
||
87 | 84 | return new Mutator( |
88 | 85 | null, |
89 | 86 | fn($value, $ctx) => |
90 | - is_null($value) ? $value : |
|
91 | - ( |
|
87 | + is_null($value) ? $value : ( |
|
92 | 88 | Assert::value(intval($value))->gt(0)->get() |
93 | 89 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
94 | 90 | ) |
@@ -100,8 +96,7 @@ discard block |
||
100 | 96 | return new Mutator( |
101 | 97 | null, |
102 | 98 | fn($value, $ctx) => |
103 | - is_null($value) ? $value : |
|
104 | - ( |
|
99 | + is_null($value) ? $value : ( |
|
105 | 100 | Assert::value(intval($value))->gt(0)->get() |
106 | 101 | ?? $ctx->raise('inválido (informe um valor de 1 à 12)') |
107 | 102 | ) |