From 628bc1399cf12dbd3e9567146b148d7336131556 Mon Sep 17 00:00:00 2001 From: Edson Nascimento Date: Thu, 2 May 2024 09:39:02 -0300 Subject: [PATCH 1/3] fix: empty url serialize --- src/Rede/Transaction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rede/Transaction.php b/src/Rede/Transaction.php index 8e8c5b2..9307a7f 100644 --- a/src/Rede/Transaction.php +++ b/src/Rede/Transaction.php @@ -377,7 +377,7 @@ public function jsonSerialize(): mixed 'origin' => $this->origin, 'distributorAffiliation' => $this->distributorAffiliation, 'storageCard' => $this->storageCard, - 'urls' => $this->urls, + 'urls' => $this->urls ?: null, 'iata' => $this->iata, 'additional' => $this->additional ], From e3cb1863272b5711028a7249e15f8f95a32823fe Mon Sep 17 00:00:00 2001 From: Edson Nascimento Date: Thu, 14 Nov 2024 11:13:44 -0300 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9E=96=20Remover=20`monolog`=20das=20dep?= =?UTF-8?q?end=C3=AAncias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 240abbd..d51cd35 100644 --- a/composer.json +++ b/composer.json @@ -9,8 +9,7 @@ "php": "^8.2", "ext-curl": "*", "ext-json": "*", - "psr/log": ">=3.0.2", - "monolog/monolog": ">=3.8" + "psr/log": "*" }, "require-dev": { "phpunit/phpunit": "^11.4.3", @@ -30,6 +29,9 @@ "Rede\\Tests\\": "tests/" } }, + "suggest": { + "monolog/monolog": "Allows more advanced logging of the application flow" + }, "scripts": { "start": "php -S localhost:8879 -t .", "format:check": "php-cs-fixer fix --dry-run --stop-on-violation", From 599cb664c6f7f5080b94a88cd8b06d53766cd37e Mon Sep 17 00:00:00 2001 From: Edson Nascimento Date: Thu, 14 Nov 2024 15:36:18 -0300 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20Adicionar=20m=C3=A9todo=20`toAr?= =?UTF-8?q?ray`=20nas=20entidades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rede/SerializeTrait.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Rede/SerializeTrait.php b/src/Rede/SerializeTrait.php index b81a80e..6122308 100644 --- a/src/Rede/SerializeTrait.php +++ b/src/Rede/SerializeTrait.php @@ -9,8 +9,14 @@ trait SerializeTrait */ public function jsonSerialize(): array { - return array_filter(get_object_vars($this), function ($value) { - return null !== $value; - }); + return $this->toArray(); + } + + /** + * @return array + */ + public function toArray(): array + { + return array_filter(get_object_vars($this), fn ($value): bool => null !== $value); } }