psalm icon indicating copy to clipboard operation
psalm copied to clipboard

query re: IssueData & plugins in 5.x

Open SignpostMarv opened this issue 2 years ago • 2 comments

With IssueData being flagged as internal in the 5.x beta, is the interface for getting a hold of issues in the AfterAnalysisEvent going to change? I'm currently getting a bunch of InternalProperty issues being flagged since pulling in 5.x 🤔

SignpostMarv avatar Aug 15 '22 13:08 SignpostMarv

Hey @SignpostMarv, can you reproduce the issue on https://psalm.dev ?

psalm-github-bot[bot] avatar Aug 15 '22 13:08 psalm-github-bot[bot]

PR for reference: https://github.com/vimeo/psalm/pull/7268

I think the @internal was added in bulk based on the directory of the class. It doesn't seem to make sense to have an internal class sent to plugins.

So I'd personally vote to move the IssueData out of the Internal namespace and remove the @internal

orklah avatar Aug 15 '22 16:08 orklah

@orklah I'm seeing that in psalm 5.7, some classes are flagged as non-internal, but the constructors are flagged as internal- this seems to be a good way to allow types to be consumed etc.

With IssueData for example, because the entire class is flagged as internal then any use of the properties is also flagged with InternalProperty instances- it seems that taking @internal off the class and shifting it to the constructor only would allow the properties to be consumed without issue and leave only the constructor to be flagged in unit tests (which is where #9424 comes in).

SignpostMarv avatar Feb 28 '23 10:02 SignpostMarv

So I'd personally vote to move the IssueData out of the Internal namespace and remove the @internal

I'd also make it final if we do that move.

weirdan avatar Feb 28 '23 12:02 weirdan