Skip to content

Add make target for removing Psalm from projects - #25

Open
gsteel wants to merge 2 commits into
laminas:1.0.xfrom
gsteel:remove-psalm
Open

gsteel wants to merge 2 commits into
laminas:1.0.xfrom
gsteel:remove-psalm

Conversation

@gsteel

@gsteel gsteel commented Oct 7, 2026

Copy link
Copy Markdown
Member

Comprehensively removes Psalm, obviously you'd only need this if you were switching to Mago.

It's worth bearing in mind that it's perfectly fine to run both tools simultaneously.

I considered adding something like:

find ./src type -f -print0 | xargs -0 sed -i '' 's/\/\*\* @psalm-suppress/d'

to remove all inline suppressions, which is potentially quite destructive, but I couldn't find the right incantation.

If anyone has some sed-foo that'll work and we think it's a good addition…

@gsteel gsteel added this to the 1.0.0 milestone Oct 7, 2026
@gsteel
gsteel requested a review from a team October 7, 2026 20:17
gsteel added 2 commits October 8, 2026 12:28
…tattributes

Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>

@froschdesign froschdesign left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍🏻

@froschdesign

Copy link
Copy Markdown
Member

to remove all inline suppressions, which is potentially quite destructive, but I couldn't find the right incantation.

A special rule for Rector? 🤷🏻‍♂️ @samsonasik

@samsonasik

Copy link
Copy Markdown
Member

@froschdesign yes, rector should can do that with set target to: Stmt and Param -> get php doc info -> removeByName('@psalm-suppress')

see https://github.com/rectorphp/rector-src/blob/d439618c7186b93603e6bd8d8e3d82dd3ceba0a4/src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php#L297-L316

see example usage

https://github.com/rectorphp/rector-src/blob/d439618c7186b93603e6bd8d8e3d82dd3ceba0a4/rules/DeadCode/Rector/Property/RemoveUselessReadOnlyTagRector.php#L105-L106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants