From 616ae19a8d9f86e7c7e7fe920ef04eed00df9362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 15:06:53 -0600 Subject: [PATCH 1/4] chore(deps): bump ridedott/merge-me-action from 2.10.39 to 2.10.40 --- .github/workflows/merge-dependabot-upgrades.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-dependabot-upgrades.yml b/.github/workflows/merge-dependabot-upgrades.yml index cf1cb90..420eec5 100644 --- a/.github/workflows/merge-dependabot-upgrades.yml +++ b/.github/workflows/merge-dependabot-upgrades.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Auto-Merge if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: ridedott/merge-me-action@v2.10.39 + uses: ridedott/merge-me-action@v2.10.40 with: # This must be used as GitHub Actions token does not support pushing # to protected branches. From 9077ba9f0ebf04b5f518b7ae2efb95b9371d8632 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 15:08:57 -0600 Subject: [PATCH 2/4] chore(deps): bump ridedott/merge-me-action from 2.10.40 to 2.10.42 --- .github/workflows/merge-dependabot-upgrades.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-dependabot-upgrades.yml b/.github/workflows/merge-dependabot-upgrades.yml index 420eec5..ee57e4b 100644 --- a/.github/workflows/merge-dependabot-upgrades.yml +++ b/.github/workflows/merge-dependabot-upgrades.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Auto-Merge if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: ridedott/merge-me-action@v2.10.40 + uses: ridedott/merge-me-action@v2.10.42 with: # This must be used as GitHub Actions token does not support pushing # to protected branches. From 4a14ce0c626423054c2b45760ceee248d87475ae Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 10 Jan 2023 22:09:08 +0000 Subject: [PATCH 3/4] fix: Amends psalm assertion syntax on `Uuid::isValid()` to prevent incorrect type inference (#486) * fix: Amends psalm assertion syntax on `Uuid::isValid()` to prevent incorrect type inference * Add static analysis test case for invalid input --- src/Uuid.php | 2 +- tests/static-analysis/ValidUuidIsNonEmpty.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Uuid.php b/src/Uuid.php index 7cbfb17..6fb1e5b 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -569,7 +569,7 @@ class Uuid implements UuidInterface * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, * but under constant factory setups, this method operates in functionally pure manners * - * @psalm-assert-if-true non-empty-string $uuid + * @psalm-assert-if-true =non-empty-string $uuid */ public static function isValid(string $uuid): bool { diff --git a/tests/static-analysis/ValidUuidIsNonEmpty.php b/tests/static-analysis/ValidUuidIsNonEmpty.php index e1490fb..8c7d6b6 100644 --- a/tests/static-analysis/ValidUuidIsNonEmpty.php +++ b/tests/static-analysis/ValidUuidIsNonEmpty.php @@ -32,4 +32,13 @@ final class ValidUuidIsNonEmpty throw new InvalidArgumentException('Not a UUID'); } + + public function givenInvalidInputValueRemainsAString(string $input): string + { + if (Uuid::isValid($input)) { + return 'It Worked!'; + } + + return $input; + } } From 5b1cd8a6cb62a438694eab8af99dcdc9f3d4df67 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 11 Jan 2023 19:43:34 -0600 Subject: [PATCH 4/4] chore: prepare release 4.7.2 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fba94b..1fa0547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 4.7.2 - 2023-01-11 + +### Fixed + +* Amend Psalm assertion syntax on `Uuid::isValid()` to prevent incorrect type + inference ([#486](https://github.com/ramsey/uuid/pull/486)). + ## 4.7.1 - 2022-12-31