Skip to content

Define minimum target PHP version for PHPStan? #1214

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

Closed
JakeQZ opened this issue Mar 25, 2025 · 1 comment · Fixed by #1216
Closed

Define minimum target PHP version for PHPStan? #1214

JakeQZ opened this issue Mar 25, 2025 · 1 comment · Fixed by #1216
Assignees
Labels
developer-specific Issues that only affect maintainers, contributors, and people submitting PRs

Comments

@JakeQZ
Copy link
Contributor

JakeQZ commented Mar 25, 2025

From #1212 (comment)

  • I think the new PHPStan error arises because it would now be possible to have CSSListItem|array as a native parameter type - but not in PHP 7.2 -
    • It would be nice if PHPStan would allow specification of a target PHP version separately from the version it runs on, so it would not generate errors that can't be fixed for the minimum target PHP version;
      • IIRC, this was not possible with Psalm, but maybe it is possible with PHPStan;
      • Running PHPStan on PHP 7.2 would almost certainly not permit the latest version.

Need to first investigate if this is possible. If it is, then decide if we also want to receive the warnings applicable to later PHP versions, somewow. If it's not possible, then there's nothing we can do.

@JakeQZ JakeQZ added developer-specific Issues that only affect maintainers, contributors, and people submitting PRs investigation needed Further investigation is needed to determine the nature of the problem, or if it even is an issue. labels Mar 25, 2025
@JakeQZ JakeQZ changed the title Define minimum target PHP version for PHPStan Define minimum target PHP version for PHPStan? Mar 25, 2025
@oliverklee
Copy link
Contributor

@oliverklee oliverklee self-assigned this Mar 25, 2025
@oliverklee oliverklee removed the investigation needed Further investigation is needed to determine the nature of the problem, or if it even is an issue. label Mar 25, 2025
oliverklee added a commit that referenced this issue Mar 25, 2025
This will help avoid it suggesting things that are only
possile in later PHP versions.

Fixes #1214
@JakeQZ JakeQZ closed this as completed in ece5633 Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-specific Issues that only affect maintainers, contributors, and people submitting PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants