Skip to content

Conversation

@stof
Copy link
Member

@stof stof commented Oct 26, 2025

Now that we don't need to support PHP 7 anymore, we can upgrade Psalm to version 6.

I disabled some rules in config, especially given Psalm is now stricter about the types of SimpleXMLElement (which returns null for properties when accessing them on an element that does not exist in its parent)

Copy link
Member

@jderusse jderusse left a comment

Choose a reason for hiding this comment

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

approved, even if I don't like writing code to please a tool that reports false positive.
(The method will never return null, with the provided arguments)

@stof
Copy link
Member Author

stof commented Oct 27, 2025

@jderusse knowing with 100% certainty that a regex won't ever produce null is hard due to the JIT backtracking limit. My analysis is based on knowing the exact regex being used and knowing which kind of input we give it (for the S3Client case, where the regex itself could backtrack but our own usage always passes a matching input generated by the parent method), which is not something tools can determine.

Ignoring errors instead of doing an assert (which is a no-op in prod) would be a lot harder as errors are not reported at this location but on next lines having to deal with string|null

@stof stof merged commit 73b0f95 into async-aws:master Oct 27, 2025
12 checks passed
@stof stof deleted the psalm_upgrade branch October 27, 2025 18:53
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