@@ -23,7 +23,7 @@ |
||
23 | 23 | * @param array|null $filters |
24 | 24 | * @return Response |
25 | 25 | */ |
26 | - public function list(?array $filters = []): Response |
|
26 | + public function list(?array $filters = []) : Response |
|
27 | 27 | { |
28 | 28 | return $this->_GET($filters ?? []); |
29 | 29 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param array|null $filters |
56 | 56 | * @return Response |
57 | 57 | */ |
58 | - public function list(?array $filters = []): Response |
|
58 | + public function list(?array $filters = []) : Response |
|
59 | 59 | { |
60 | 60 | return $this->_GET($filters ?? []); |
61 | 61 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @param array|null $filters |
32 | 32 | * @return Response |
33 | 33 | */ |
34 | - public function list(?array $filters = []): Response |
|
34 | + public function list(?array $filters = []) : Response |
|
35 | 35 | { |
36 | 36 | return $this->_GET($filters ?? []); |
37 | 37 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * @param array|null $filters |
47 | 47 | * @return Response |
48 | 48 | */ |
49 | - public function list(?array $filters = []): Response |
|
49 | + public function list(?array $filters = []) : Response |
|
50 | 50 | { |
51 | 51 | return $this->_GET($filters ?? []); |
52 | 52 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param array|null $filters |
56 | 56 | * @return Response |
57 | 57 | */ |
58 | - public function list(?array $filters = []): Response |
|
58 | + public function list(?array $filters = []) : Response |
|
59 | 59 | { |
60 | 60 | return $this->_GET($filters ?? []); |
61 | 61 | } |
@@ -13,76 +13,76 @@ |
||
13 | 13 | class Antifraud extends Model |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * @param array|null $data |
|
18 | - * array de dados do recurso `Antifraud` |
|
19 | - * |
|
20 | - * + [`'provider'`] array (opcional) dos dados do Address. |
|
21 | - * +   [`'name'`] string (opcional). |
|
22 | - * +   [`'credentials'`] array (opcional). |
|
23 | - * + [`'settings'`] array (opcional) dos dados do Address. |
|
24 | - * +   [`'enabled'`] bool (opcional). |
|
25 | - * +   [`'environment'`] enum {`'production'` | `'test'`} (opcional). |
|
26 | - * +   [`'consult_mode'`] enum {`'auto'` | `'manual'`} (opcional). |
|
27 | - * +   [`'capture_on_approval'`] bool (opcional). |
|
28 | - * +   [`'cancel_on_refused'`] bool (opcional). |
|
29 | - * +   [`'review_score_threshold'`] float (opcional). |
|
30 | - */ |
|
31 | - public function __construct(?array $data = []) |
|
32 | - { |
|
16 | + /** |
|
17 | + * @param array|null $data |
|
18 | + * array de dados do recurso `Antifraud` |
|
19 | + * |
|
20 | + * + [`'provider'`] array (opcional) dos dados do Address. |
|
21 | + * +   [`'name'`] string (opcional). |
|
22 | + * +   [`'credentials'`] array (opcional). |
|
23 | + * + [`'settings'`] array (opcional) dos dados do Address. |
|
24 | + * +   [`'enabled'`] bool (opcional). |
|
25 | + * +   [`'environment'`] enum {`'production'` | `'test'`} (opcional). |
|
26 | + * +   [`'consult_mode'`] enum {`'auto'` | `'manual'`} (opcional). |
|
27 | + * +   [`'capture_on_approval'`] bool (opcional). |
|
28 | + * +   [`'cancel_on_refused'`] bool (opcional). |
|
29 | + * +   [`'review_score_threshold'`] float (opcional). |
|
30 | + */ |
|
31 | + public function __construct(?array $data = []) |
|
32 | + { |
|
33 | 33 | parent::__construct($data); |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | - protected function schema(SchemaBuilder $schema): Schema |
|
37 | - { |
|
36 | + protected function schema(SchemaBuilder $schema): Schema |
|
37 | + { |
|
38 | 38 | $schema->has('provider', AntifraudProvider::class)->nullable(); |
39 | 39 | $schema->has('settings', AntifraudSettings::class)->nullable(); |
40 | 40 | |
41 | 41 | return $schema->build(); |
42 | - } |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * Retorna o valor da propriedade `provider`. |
|
46 | - * |
|
47 | - * @return AntifraudProvider|null |
|
48 | - */ |
|
49 | - public function getProvider(): ?AntifraudProvider |
|
50 | - { |
|
44 | + /** |
|
45 | + * Retorna o valor da propriedade `provider`. |
|
46 | + * |
|
47 | + * @return AntifraudProvider|null |
|
48 | + */ |
|
49 | + public function getProvider(): ?AntifraudProvider |
|
50 | + { |
|
51 | 51 | return $this->get('provider'); |
52 | - } |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Seta o valor da propriedade `provider`. |
|
56 | - * |
|
57 | - * @param AntifraudProvider|null $provider |
|
58 | - * @return self |
|
59 | - */ |
|
60 | - public function setProvider(?AntifraudProvider $provider = null): self |
|
61 | - { |
|
54 | + /** |
|
55 | + * Seta o valor da propriedade `provider`. |
|
56 | + * |
|
57 | + * @param AntifraudProvider|null $provider |
|
58 | + * @return self |
|
59 | + */ |
|
60 | + public function setProvider(?AntifraudProvider $provider = null): self |
|
61 | + { |
|
62 | 62 | $this->set('provider', $provider); |
63 | 63 | return $this; |
64 | - } |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Retorna o valor da propriedade `settings`. |
|
68 | - * |
|
69 | - * @return AntifraudSettings|null |
|
70 | - */ |
|
71 | - public function getSettings(): ?AntifraudSettings |
|
72 | - { |
|
66 | + /** |
|
67 | + * Retorna o valor da propriedade `settings`. |
|
68 | + * |
|
69 | + * @return AntifraudSettings|null |
|
70 | + */ |
|
71 | + public function getSettings(): ?AntifraudSettings |
|
72 | + { |
|
73 | 73 | return $this->get('settings'); |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * Seta o valor da propriedade `settings`. |
|
78 | - * |
|
79 | - * @param AntifraudSettings|null $settings |
|
80 | - * @return self |
|
81 | - */ |
|
82 | - public function setSettings(?AntifraudSettings $settings = null): self |
|
83 | - { |
|
76 | + /** |
|
77 | + * Seta o valor da propriedade `settings`. |
|
78 | + * |
|
79 | + * @param AntifraudSettings|null $settings |
|
80 | + * @return self |
|
81 | + */ |
|
82 | + public function setSettings(?AntifraudSettings $settings = null): self |
|
83 | + { |
|
84 | 84 | $this->set('settings', $settings); |
85 | 85 | return $this; |
86 | - } |
|
86 | + } |
|
87 | 87 | |
88 | 88 | } |
89 | 89 | \ No newline at end of file |
@@ -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 | } |
@@ -24,8 +24,9 @@ |
||
24 | 24 | |
25 | 25 | public function __construct(array $data = [], array $relations = [], ?string $name = null) |
26 | 26 | { |
27 | - if (is_numeric(key($data))) |
|
28 | - throw new \Exception('Dados mal formatados passado para o construtor da classe ' . ClassUtil::basename(static::class)); |
|
27 | + if (is_numeric(key($data))) { |
|
28 | + throw new \Exception('Dados mal formatados passado para o construtor da classe ' . ClassUtil::basename(static::class)); |
|
29 | + } |
|
29 | 30 | |
30 | 31 | $this->data = $data; |
31 | 32 | $this->relations = $relations; |
@@ -82,8 +82,7 @@ discard block |
||
82 | 82 | null, |
83 | 83 | fn($value, $ctx) => |
84 | 84 | is_null($value) ? |
85 | - $value : |
|
86 | - Assert::value($value)->asCpf(false)->or()->asCnpj(false)->get() ?? $ctx->raise('inválido') |
|
85 | + $value : Assert::value($value)->asCpf(false)->or()->asCnpj(false)->get() ?? $ctx->raise('inválido') |
|
87 | 86 | ); |
88 | 87 | } |
89 | 88 | |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | null, |
94 | 93 | fn($value, $ctx) => |
95 | 94 | is_null($value) ? |
96 | - $value : |
|
97 | - Assert::value($value)->email()->get() ?? $ctx->raise('inválido') |
|
95 | + $value : Assert::value($value)->email()->get() ?? $ctx->raise('inválido') |
|
98 | 96 | ); |
99 | 97 | } |
100 | 98 | |
@@ -104,8 +102,7 @@ discard block |
||
104 | 102 | null, |
105 | 103 | fn($value, $ctx) => |
106 | 104 | is_null($value) ? |
107 | - $value : |
|
108 | - Assert::value($value)->asDigits()->lbetween(10, 11)->get() ?? $ctx->raise('inválido') |
|
105 | + $value : Assert::value($value)->asDigits()->lbetween(10, 11)->get() ?? $ctx->raise('inválido') |
|
109 | 106 | ); |
110 | 107 | } |
111 | 108 | |
@@ -113,7 +110,7 @@ discard block |
||
113 | 110 | { |
114 | 111 | return new Mutator( |
115 | 112 | null, |
116 | - function ($value, $ctx) { |
|
113 | + function($value, $ctx) { |
|
117 | 114 | $d = \DateTime::createFromFormat('Y-m-d', $value); |
118 | 115 | |
119 | 116 | return is_null($value) || |