Skip to content

Conversation

phpstan-bot
Copy link
Collaborator

Update PhpStorm stubs

@VincentLanglet
Copy link
Contributor

Hi @ondrejmirtes,

The failing test is because https://github.com/JetBrains/phpstorm-stubs/pull/1652/files was merged which add a throw annotation to the modify method. You reported I forgot this here JetBrains/phpstorm-stubs#1646 (comment) on a PR which already introduce some issue on PHPStan side.

It seems kinda related to phpstan/phpstan#11503 (with the sub method).

Stubs are correct for PHP >= 8.3 but in PHP < 8.3:

  • DateTime::sub throws void
  • DateTimeImmutable::sub throws void
  • DateTime::modify throws void
  • DateTimeImmutable::modify throws void

Should it be done with a DynamicMethodThrowTypeExtension for PHP < 8.3 or something else ?

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.

3 participants