From 50623d684f107dcf19d43334bb433ae2a09bc13a Mon Sep 17 00:00:00 2001 From: Mauro Tschiedel Date: Thu, 19 Oct 2023 20:19:32 -0300 Subject: [PATCH 1/4] Update Tracking.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No tracking, a variável filtered estava sendo passada como string padrão. Modificada para suportar o valor passado pelo metodo. --- src/Services/Tracking/Tracking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Tracking/Tracking.php b/src/Services/Tracking/Tracking.php index fd8cd7b8..976ce6fd 100644 --- a/src/Services/Tracking/Tracking.php +++ b/src/Services/Tracking/Tracking.php @@ -19,7 +19,7 @@ private function buildEndpoint(string $trackingCode, string $filtered): void { $endpoint = 'srorastro/v1/objetos/' . $trackingCode; if ($filtered) { - $endpoint .= '?resultado=U'; + $endpoint .= '?resultado='.$filtered; } $this->setEndpoint($endpoint); From 798cc69a8a57a08d5c1d524514d5408c9326a99f Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Wed, 22 Nov 2023 21:37:53 -0300 Subject: [PATCH 2/4] fix: using filter on tracking code --- README.md | 5 ++++- src/Services/Tracking/Tracking.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4550efa5..1135bd17 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,10 @@ $correios->setLotId(requestNumber: '20230831LT'); ### Rastro (Tracking) ```PHP -$response = $correios->tracking()->get(trackingCode: 'AASD546115A'); +$response = $correios->tracking()->get( + trackingCode: 'AASD546115A', + filtered: 'U' +); ``` ### Preço (Price) diff --git a/src/Services/Tracking/Tracking.php b/src/Services/Tracking/Tracking.php index 976ce6fd..bb8a1f59 100644 --- a/src/Services/Tracking/Tracking.php +++ b/src/Services/Tracking/Tracking.php @@ -19,7 +19,7 @@ private function buildEndpoint(string $trackingCode, string $filtered): void { $endpoint = 'srorastro/v1/objetos/' . $trackingCode; if ($filtered) { - $endpoint .= '?resultado='.$filtered; + $endpoint .= "?resultado=$filtered"; } $this->setEndpoint($endpoint); From 4672e23e261ffaaac70568e1b4df18a495b407cf Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Wed, 22 Nov 2023 21:52:29 -0300 Subject: [PATCH 3/4] docs: update documentation files --- CHANGELOG.md | 18 ++++++++++++++++++ composer.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..9e7d0908 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# Change Log + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [1.0.1] - 2023-11-22 + +### Fixed + +- Fix the tracking filter param usage + + +## [1.0.0] - 2023-09-08 + +### Added + +- Initial release \ No newline at end of file diff --git a/composer.json b/composer.json index e56958ae..1a6611e2 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "devaguia/correios-php", - "version": "1.0.0", + "version": "1.0.1", "description": "Correios API library for PHP", "license": "GPL-3.0", "scripts": { From da6192f10c2d21c56776716bb44e143e0a9cfdf4 Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Wed, 22 Nov 2023 22:04:11 -0300 Subject: [PATCH 4/4] build: update the github workflow --- .github/workflows/ci-cd-tag.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci-cd-tag.yml b/.github/workflows/ci-cd-tag.yml index 766849a0..92a42eaa 100644 --- a/.github/workflows/ci-cd-tag.yml +++ b/.github/workflows/ci-cd-tag.yml @@ -45,3 +45,12 @@ jobs: git push origin v$TAG_VERSION echo "All right! 🎉" + + - name: Update the packagist version ⬆️ + run: | + curl \ + -X POST \ + -H "Content Type: application/json" \ + -H "Secret: ${{ secrets.PACKAGISTTOKEN }}" \ + https://packagist.org/api/github?username=devaguia +