Skip to content

[TASK] Disable some rules from Rector Type Perfect#1575

Merged
JakeQZ merged 1 commit intomainfrom
task/type-perfect-rules
Apr 19, 2026
Merged

[TASK] Disable some rules from Rector Type Perfect#1575
JakeQZ merged 1 commit intomainfrom
task/type-perfect-rules

Conversation

@oliverklee
Copy link
Copy Markdown
Collaborator

The two type-narrowing rules tend to have too many false positives at the moment.

The two type-narrowing rules tend to have too many false
positives at the moment.
@oliverklee oliverklee requested a review from JakeQZ April 19, 2026 08:02
@oliverklee oliverklee self-assigned this Apr 19, 2026
@oliverklee oliverklee added the developer-specific Issues that only affect maintainers, contributors, and people submitting PRs label Apr 19, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 72.927%. remained the same — task/type-perfect-rules into main

Copy link
Copy Markdown
Collaborator

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

We should revisit this in future and reenable type narrowing. But in the meantime, there are issues with it:

  • It does not seem to play well with union types -
    • We should redesign the API to avoid union types, perhaps introducing classes to wrap the type;
  • The warning messages are rather cryptic, identifying the callee as the source of the problem, rather than the caller, making them sometimes almost impossible to diagnose -
    • This needs improvement in TypePerfect or PHPStan or whatever is obfuscating the details.

@JakeQZ JakeQZ merged commit b9192ca into main Apr 19, 2026
24 checks passed
@JakeQZ JakeQZ deleted the task/type-perfect-rules branch April 19, 2026 17:15
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 this pull request may close these issues.

3 participants