Skip to content

Psalm refactoring#357

Merged
shadowhand merged 1 commit into
webmozarts:masterfrom
danog:psalm_refactoring
May 20, 2026
Merged

Psalm refactoring#357
shadowhand merged 1 commit into
webmozarts:masterfrom
danog:psalm_refactoring

Conversation

@danog
Copy link
Copy Markdown
Contributor

@danog danog commented May 11, 2026

Various psalm-related fixes:

  • Turn all @psalm-param and @psalm-return annotations into @param and @return annotations (this avoids issues where @psalm- annotations are treated as second-class and forgotten about, and thus proper types aren't even mentioned in some cases). All major IDEs already support Psalm syntax in @param and @return annotations.
  • Autogenerate and run static analysis tests for both return and non-return usages
  • Remove some invalid assertions, and move assertions that were invalidly put into @psalm-param into a proper @psalm-assertion
  • Fix native return types of the mixin
  • Add a Psalm plugin to provide properly asserted return types to all methods
  • Describe some return assertions using templates (as fallback if the plugin isn't installed)
  • Fix template-based assertions in the mixin

@danog danog force-pushed the psalm_refactoring branch 2 times, most recently from 960e473 to 7bab1ae Compare May 11, 2026 09:00
Comment thread bin/src/MixinGenerator.php Outdated
@danog danog force-pushed the psalm_refactoring branch from 7bab1ae to 028db22 Compare May 11, 2026 16:13
@danog
Copy link
Copy Markdown
Contributor Author

danog commented May 14, 2026

Ping @shadowhand :)

@danog danog force-pushed the psalm_refactoring branch from 028db22 to 9256068 Compare May 18, 2026 10:09
@danog
Copy link
Copy Markdown
Contributor Author

danog commented May 18, 2026

Rebased!

Copy link
Copy Markdown
Collaborator

@shadowhand shadowhand left a comment

Choose a reason for hiding this comment

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

Overall, looks good. The changes to composer.json are misplaced, though.

Comment thread composer.json Outdated
@danog danog force-pushed the psalm_refactoring branch from 151bb9f to 537d6d5 Compare May 18, 2026 11:36
@danog
Copy link
Copy Markdown
Contributor Author

danog commented May 18, 2026

Fixed!

@danog danog force-pushed the psalm_refactoring branch 6 times, most recently from b64fd58 to b3ce7e4 Compare May 20, 2026 12:04
@danog danog force-pushed the psalm_refactoring branch from b3ce7e4 to dc75364 Compare May 20, 2026 12:10
@shadowhand shadowhand merged commit e946580 into webmozarts:master May 20, 2026
9 checks passed
@shadowhand
Copy link
Copy Markdown
Collaborator

Released in v2.4.0.

@danog
Copy link
Copy Markdown
Contributor Author

danog commented May 20, 2026

Thanks!

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