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

Update functionMap.php for SplFileInfo::getPathInfo return type #3487

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

DannyvdSluijs
Copy link
Contributor

SplFileInfo::getPathInfo can return null as per documentation https://www.php.net/manual/en/splfileinfo.getpathinfo.php

After trying to report the issue in the distribution repo I was sent here, see https://github.com/phpstan/phpstan/issues/new?assignees=&labels=&projects=&template=Function_signature_mismatch.md. So I hope this is the right place and the right changes. Feel free to ping me if anything else is needed.

This mismatch was discovered using the following code snippet

<?php declare(strict_types = 1);


$file = tempnam(sys_get_temp_dir(), 'phpstan-');
$info = new \SplFileInfo($file);

echo $info->getPathInfo()?->getPathname();

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 2.0.x. PHPStan 2.0 is not going to be released for months. If your code is relevant on 1.12.x and you want it to be released sooner, please rebase your pull request and change its target to 1.12.x.

@DannyvdSluijs DannyvdSluijs changed the base branch from 2.0.x to 1.12.x September 26, 2024 10:21
@DannyvdSluijs DannyvdSluijs changed the base branch from 1.12.x to 2.0.x September 26, 2024 10:21
@DannyvdSluijs
Copy link
Contributor Author

DannyvdSluijs commented Sep 26, 2024

You've opened the pull request against the latest branch 2.0.x. PHPStan 2.0 is not going to be released for months. If your code is relevant on 1.12.x and you want it to be released sooner, please rebase your pull request and change its target to 1.12.x.

Rebased and retargetted to 1.12.x

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather be a little bit calmer if it was a benevolent union type, so that it doesn't bother people who are sure it cannot fail for them.

resources/functionMap.php Outdated Show resolved Hide resolved
DannyvdSluijs and others added 2 commits September 30, 2024 20:42
Co-authored-by: Ondřej Mirtes <ondrej@mirtes.cz>
@ondrejmirtes ondrejmirtes merged commit d3bc3e3 into phpstan:1.12.x Oct 6, 2024
480 of 499 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@DannyvdSluijs DannyvdSluijs deleted the patch-1 branch October 6, 2024 14:30
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