Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore support for null coalesce on match expressions #10422

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

tscni
Copy link
Contributor

@tscni tscni commented Nov 29, 2023

#10068 added isset() restrictions that didn't consider null coalesces on match expressions.
This restores that support by converting the match expression to a virtual variable for the isset analysis, similar to other incompatible expressions.

vimeo#10068 added isset restrictions that didn't consider null coalesces on match expressions.
This restores that support by converting the match expression to a virtual variable for the isset analysis, similar to other incompatible expressions.
@@ -39,6 +39,7 @@ public static function analyze(
|| $root_expr instanceof PhpParser\Node\Expr\MethodCall
|| $root_expr instanceof PhpParser\Node\Expr\StaticCall
|| $root_expr instanceof PhpParser\Node\Expr\Cast
|| $root_expr instanceof PhpParser\Node\Expr\Match_
Copy link
Contributor Author

@tscni tscni Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on #10068 (comment), ClassConstFetch and AssignRef are currently supported in the isset analyzer for exactly the same reasons and shouldn't actually be there:

|| $stmt instanceof PhpParser\Node\Expr\ClassConstFetch
|| $stmt instanceof PhpParser\Node\Expr\AssignRef;

I'm wondering whether they should be moved here too.

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Dec 2, 2023
@orklah
Copy link
Collaborator

orklah commented Dec 2, 2023

Thanks!

@orklah orklah merged commit 794bdaa into vimeo:5.x Dec 2, 2023
50 of 51 checks passed
tcarrio pushed a commit to open-feature/php-sdk that referenced this pull request Dec 4, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vimeo/psalm](https://github.com/vimeo/psalm) | `~5.16.0` ->
`~5.17.0` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/vimeo%2fpsalm/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/vimeo%2fpsalm/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/vimeo%2fpsalm/5.16.0/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/vimeo%2fpsalm/5.16.0/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vimeo/psalm (vimeo/psalm)</summary>

### [`v5.17.0`](https://github.com/vimeo/psalm/releases/tag/5.17.0)

[Compare
Source](https://github.com/vimeo/psalm/compare/5.16.0...5.17.0)

<!-- Release notes generated using configuration in .github/release.yml
at 5.x -->

#### What's Changed

##### Features

- Implement by-ref closure use analysis by
[@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10419

##### Fixes

- Update MongoDB stubs for 1.17 by
[@&#8203;alcaeus](https://github.com/alcaeus) in
[vimeo/psalm#10402
- Fix backtick analysis by [@&#8203;danog](https://github.com/danog)
in
[vimeo/psalm#10409
- Declare we do not support document highlighting by
[@&#8203;tm1000](https://github.com/tm1000) in
[vimeo/psalm#10408
- update define types to be correct by
[@&#8203;kkmuffme](https://github.com/kkmuffme) in
[vimeo/psalm#10423
- Fix return type of DOMXPath::query by
[@&#8203;nielsdos](https://github.com/nielsdos) in
[vimeo/psalm#10443
- Fix CLI -r error by [@&#8203;kkmuffme](https://github.com/kkmuffme)
in
[vimeo/psalm#10442
- Use correct file path while adding unused suppressions for virtual
\__… by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10434
- Restore support for null coalesce on match expressions by
[@&#8203;tscni](https://github.com/tscni) in
[vimeo/psalm#10422
- Fix static magic method pureness not being inherited from traits by
[@&#8203;tscni](https://github.com/tscni) in
[vimeo/psalm#10429
- Fix POSIX only detection of absolute paths by
[@&#8203;rarila](https://github.com/rarila) in
[vimeo/psalm#10441
- Emit UnusedPsalmSuppress issues for suppressed issues already removed
by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10431
- Use keyed arrays when assigning literal union keys & assertion fixes
by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10439

##### Internal changes

- use branch name to randomize tests to ensure test dependencies will
error by [@&#8203;kkmuffme](https://github.com/kkmuffme) in
[vimeo/psalm#10424

#### New Contributors

- [@&#8203;nielsdos](https://github.com/nielsdos) made their first
contribution in
[vimeo/psalm#10443

**Full Changelog**:
vimeo/psalm@5.16.0...5.17.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-feature/php-sdk).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44MS4zIiwidXBkYXRlZEluVmVyIjoiMzcuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
tcarrio pushed a commit to open-feature/php-sdk that referenced this pull request Dec 5, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vimeo/psalm](https://github.com/vimeo/psalm) | `~5.16.0` ->
`~5.17.0` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/vimeo%2fpsalm/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/vimeo%2fpsalm/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/vimeo%2fpsalm/5.16.0/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/vimeo%2fpsalm/5.16.0/5.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vimeo/psalm (vimeo/psalm)</summary>

### [`v5.17.0`](https://github.com/vimeo/psalm/releases/tag/5.17.0)

[Compare
Source](https://github.com/vimeo/psalm/compare/5.16.0...5.17.0)

<!-- Release notes generated using configuration in .github/release.yml
at 5.x -->

#### What's Changed

##### Features

- Implement by-ref closure use analysis by
[@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10419

##### Fixes

- Update MongoDB stubs for 1.17 by
[@&#8203;alcaeus](https://github.com/alcaeus) in
[vimeo/psalm#10402
- Fix backtick analysis by [@&#8203;danog](https://github.com/danog)
in
[vimeo/psalm#10409
- Declare we do not support document highlighting by
[@&#8203;tm1000](https://github.com/tm1000) in
[vimeo/psalm#10408
- update define types to be correct by
[@&#8203;kkmuffme](https://github.com/kkmuffme) in
[vimeo/psalm#10423
- Fix return type of DOMXPath::query by
[@&#8203;nielsdos](https://github.com/nielsdos) in
[vimeo/psalm#10443
- Fix CLI -r error by [@&#8203;kkmuffme](https://github.com/kkmuffme)
in
[vimeo/psalm#10442
- Use correct file path while adding unused suppressions for virtual
\__… by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10434
- Restore support for null coalesce on match expressions by
[@&#8203;tscni](https://github.com/tscni) in
[vimeo/psalm#10422
- Fix static magic method pureness not being inherited from traits by
[@&#8203;tscni](https://github.com/tscni) in
[vimeo/psalm#10429
- Fix POSIX only detection of absolute paths by
[@&#8203;rarila](https://github.com/rarila) in
[vimeo/psalm#10441
- Emit UnusedPsalmSuppress issues for suppressed issues already removed
by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10431
- Use keyed arrays when assigning literal union keys & assertion fixes
by [@&#8203;danog](https://github.com/danog) in
[vimeo/psalm#10439

##### Internal changes

- use branch name to randomize tests to ensure test dependencies will
error by [@&#8203;kkmuffme](https://github.com/kkmuffme) in
[vimeo/psalm#10424

#### New Contributors

- [@&#8203;nielsdos](https://github.com/nielsdos) made their first
contribution in
[vimeo/psalm#10443

**Full Changelog**:
vimeo/psalm@5.16.0...5.17.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-feature/php-sdk).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44MS4zIiwidXBkYXRlZEluVmVyIjoiMzcuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tom Carrio <tom@carrio.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants