Skip to content

Fix preg_match_all stub#4325

Merged
muglug merged 4 commits intovimeo:masterfrom
Synchro:master
Oct 14, 2020
Merged

Fix preg_match_all stub#4325
muglug merged 4 commits intovimeo:masterfrom
Synchro:master

Conversation

@Synchro
Copy link
Contributor

@Synchro Synchro commented Oct 14, 2020

preg_match_all can return false given a bad pattern.

This PR fixes the stub, and adds a test for it. The test triggers a warning, so I suppress that since we're only interested in the false return value.

@muglug
Copy link
Collaborator

muglug commented Oct 14, 2020

Add @psalm-ignore-falsable-return to the signature as well

@muglug muglug merged commit e172e88 into vimeo:master Oct 14, 2020
@muglug
Copy link
Collaborator

muglug commented Oct 14, 2020

Thanks!

muglug pushed a commit that referenced this pull request Oct 15, 2020
* preg_match_all can return false

* Test for preg_match_all returning false

* Fix test

* Add @psalm-ignore-falsable-return
danog pushed a commit to danog/psalm that referenced this pull request Jan 29, 2021
* preg_match_all can return false

* Test for preg_match_all returning false

* Fix test

* Add @psalm-ignore-falsable-return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants