Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Aug 25, 2025

@kkmuffme this is for check by ternary, that supported by PHPStan via:

        $scope = ScopeFetcher::fetch($funcCall);
        $type = $scope->getPhpVersion()
            ->getType();

        if (! $type instanceof IntegerRangeType) {
            // next todo: check version_compare() and if() usage
            return false;
        }

        return $type->getMin() === 80100;

TODO for next PRs:

  • check version_compare()
  • check if() usage

Ref rectorphp/rector#9327

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

Next improvement for version_compare and under if can be in separate PR :)

@samsonasik samsonasik merged commit c46da7c into main Aug 25, 2025
6 checks passed
@samsonasik samsonasik deleted the skip-check-phpversion branch August 25, 2025 09:55
@samsonasik
Copy link
Member Author

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.

2 participants