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

DateInterval::createFromDateString can be false #7758

Merged
merged 2 commits into from Mar 6, 2022

Conversation

Ne-Lexa
Copy link
Contributor

@Ne-Lexa Ne-Lexa commented Mar 5, 2022

Fixes #7747

@orklah
Copy link
Collaborator

orklah commented Mar 6, 2022

Thanks! Can you also do this change in Callmap_historical? There should be a match between Callmap (who is the current state) and another Callmap file (who'll show when this particular signature was introduced)

@Ne-Lexa
Copy link
Contributor Author

Ne-Lexa commented Mar 6, 2022

@orklah, changes made.

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Mar 6, 2022
@orklah
Copy link
Collaborator

orklah commented Mar 6, 2022

Thanks!

@orklah orklah merged commit a134b25 into vimeo:4.x Mar 6, 2022
@orklah
Copy link
Collaborator

orklah commented Mar 6, 2022

And congrats for your first PR!

muglug added a commit that referenced this pull request Apr 27, 2022
DateInterval::createFromDateString can be false
@boesing
Copy link
Contributor

boesing commented Aug 26, 2022

Was this possibly reverted?

Does not create an issue in 4.26 nor in latest 5.x commit:
https://psalm.dev/r/49ce1d4e62

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/49ce1d4e62
<?php

function foo(): DateInterval
{
    return DateInterval::createFromDateString('foo');
}
Psalm output (using commit afe85fa):

No issues!

@AndrolGenhald
Copy link
Collaborator

@boesing Still works, that's just ignoreInternalFunctionFalseReturn being annoying.

The fact that there are so many config values that most people never look at, and the amount of work it takes to go through all of them manually, is what motivated me to open #7630, but I've been short on time lately. If you or someone else wants to go through the options and decide what value is "strictest" for each of them I would guess the actual implementation of it should be relatively simple.

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/760586cee1
<?php

function foo(): DateInterval
{
    $foo = DateInterval::createFromDateString('foo');
    /** @psalm-trace $foo */
    return $foo;
}
Psalm output (using commit afe85fa):

INFO: Trace - 7:5 - $foo: DateInterval|false

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.

TypeDoesNotContainType - DateInterval does not contain false
4 participants