Skip to content

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Oct 23, 2023

This causes issue in thecodingmachine/safe as their generator takes phpstan's fcnmap and generates function signatures. However, now it generates e.g. function date_create_immutable(string $datetime = "now", ?\\DateTimeZone $timezone = null): \DateTimeImmutable. Therefore, this fix is needed. (https://github.com/thecodingmachine/safe/actions/runs/6613051619/job/17960125168?pr=432#step:18:1115)

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

Verified

This commit was signed with the committer’s verified signature.
simPod Simon Podlipsky
This causes issue in thecodingmachine/safe as their generator takes phpstan's fcnmap and generates function signatures. However, now it generates e.g. `function date_create_immutable(string $datetime = "now", ?\\DateTimeZone $timezone = null): \DateTimeImmutable`. Therefore, this fix is needed.
@simPod simPod changed the base branch from 1.11.x to 1.10.x October 23, 2023 11:50
@ondrejmirtes
Copy link
Member

Therefore, this fix is needed.

Hi, I will merge this just to make everyone's life easier, but I disagree with the premise that the fix is really needed on PHPStan's side. PHPStan doesn't need this change and uses reflection data correctly.

Also other projects might benefit from combining multiple data sources as PHPStan does because functionMap does not always offer the full picture.

For example: PHPStan does not need to have delta files for PHP 8.3 because it already reads stuff that changed in PHP 8.3 from https://github.com/phpstan/php-8-stubs. So if thecodingmachine/safe reads these files and assumes that everything is correct for PHP 8.3, it's going to be wrong.

@ondrejmirtes ondrejmirtes merged commit 110ab29 into phpstan:1.10.x Oct 29, 2023
@simPod simPod deleted the fix branch October 29, 2023 13:56
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.

None yet

3 participants