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

Correct return type of DateTimeImmutable sub method stub #8583

Merged
merged 3 commits into from Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions stubs/CoreImmutableClasses.phpstub
Expand Up @@ -58,10 +58,8 @@ class DateTimeImmutable implements DateTimeInterface

/**
* @psalm-mutation-free
* @return static|false this method can fail in case an {@see DateInterval} with relative
* week days is passed in.
*
* @see https://github.com/php/php-src/blob/534127d3b22b193ffb9511c4447584f0d2bd4e24/ext/date/php_date.c#L3157-L3160
* @return static

*/
public function sub(DateInterval $interval) {}

Expand Down
2 changes: 1 addition & 1 deletion tests/MethodCallTest.php
Expand Up @@ -271,7 +271,7 @@ final class MyDate extends DateTimeImmutable {}

$b = (new DateTimeImmutable())->modify("+3 hours");',
'assertions' => [
'$yesterday' => 'MyDate|false',
'$yesterday' => 'MyDate',
'$b' => 'DateTimeImmutable',
],
],
Expand Down