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

chore: PHPStan ignore line #580

Merged
merged 3 commits into from
Apr 26, 2024
Merged

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Apr 26, 2024

Ignore this error:

Cannot access offset 0|1|2|3 on FFI\CData.

For #564

@tienvx tienvx requested a review from JP-Ellis April 26, 2024 03:55
Copy link
Contributor

@JP-Ellis JP-Ellis left a comment

Choose a reason for hiding this comment

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

Approving, but just wanting to check: Is it possible to ignore a specific error?

By analogy, in Python we have:

x: int = "foo" # noqa   <-- Generic 'ignore all errors'; bad practice
x: int = "foo" # noqa: some-error <-- Only ignores 'some-error'; best practice

@tienvx
Copy link
Contributor Author

tienvx commented Apr 26, 2024

Is it possible to ignore a specific error?

Yes, it's possible, but only when PHPStan version 1.11 is released (sometime in May). The current version is 1.10.67, which is the last version of 1.10, doesn't support it.

So I use 2 solutions, and will remove the other when 1.11 is released.

@tienvx tienvx merged commit fb16ea6 into pact-foundation:master Apr 26, 2024
26 checks passed
@tienvx tienvx deleted the ignore-line branch April 26, 2024 06:14
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