Skip to content

Comments

Introduce Rector, adding parameter, return and property types throughout#135

Merged
gsteel merged 16 commits intolaminas:5.0.xfrom
mairo744:refactor/rector-v5
Jul 24, 2025
Merged

Introduce Rector, adding parameter, return and property types throughout#135
gsteel merged 16 commits intolaminas:5.0.xfrom
mairo744:refactor/rector-v5

Conversation

@mairo744
Copy link

Q A
Documentation no
Bugfix no
BC Break yes
New Feature no
RFC no
QA yes

Description

This PR introduces strict typing enforcement using Rector.

  • Adds Rector to the project and configures it to enforce strict typing rules.
  • Applies readonly properties where applicable.
  • Adds scalar and class parameter types, return types, and property types throughout the codebase.
  • Updates psalm-baseline.xml to remove ignored issues that are now resolved through typing improvements.

mmalac added 3 commits July 19, 2025 22:59
…ate Rector for automated refactoring

Signed-off-by: mmalac <mmalac@sygic.com>
…t listener setup, and update Rector/psalm configurations

Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744 mairo744 force-pushed the refactor/rector-v5 branch from 4dd6682 to 8e25727 Compare July 19, 2025 20:59
Signed-off-by: mmalac <mmalac@sygic.com>
@gsteel gsteel added BC Break Enhancement QA Quality assurance tasks such as static analysis improvements labels Jul 21, 2025
@gsteel gsteel added this to the 5.0.0 milestone Jul 21, 2025
…` across strategies and tests

Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744 mairo744 force-pushed the refactor/rector-v5 branch from 78436c2 to d8f2fc2 Compare July 21, 2025 20:09
mmalac added 3 commits July 21, 2025 22:11
…ation

Signed-off-by: mmalac <mmalac@sygic.com>
…ine entries

Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Sorry @mairo744 I messed up the callable signature on my last review

mmalac added 6 commits July 22, 2025 21:18
Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744 mairo744 force-pushed the refactor/rector-v5 branch from 4fb88f3 to d3def69 Compare July 22, 2025 20:10
@mairo744 mairo744 requested a review from gsteel July 23, 2025 12:52
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Overall, please drop some of the introduced rector rules, specifically ones that create big diffs on tests that are more style than substance.

There are tangible benefits to the rules, so I'm not against introducing them in a separate patch, but for now, this patch is getting difficult to review.

This reverts commit 307b765.

# Conflicts:
#	rector.php

Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744 mairo744 force-pushed the refactor/rector-v5 branch from 9abbc7c to 4af6e51 Compare July 23, 2025 19:28
Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744
Copy link
Author

Overall, please drop some of the introduced rector rules, specifically ones that create big diffs on tests that are more style than substance.

There are tangible benefits to the rules, so I'm not against introducing them in a separate patch, but for now, this patch is getting difficult to review.

Thank you for the feedback. I agree with your points. I've reverted the commit that applied phpunit code quality rector rules. It’ll be easy to introduce those rules incrementally in separate PRs later on.

@mairo744 mairo744 requested a review from gsteel July 23, 2025 19:48
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thanks @mairo744 - This is a great improvement 👍

@gsteel gsteel requested a review from samsonasik July 24, 2025 08:59
@gsteel
Copy link
Member

gsteel commented Jul 24, 2025

Asking @samsonasik for a second pair of eyes due to the size of this PR

@gsteel gsteel changed the title Refactor/rector v5 Introduce Rector, adding parameter, return and property types throughout Jul 24, 2025
@gsteel gsteel self-assigned this Jul 24, 2025
@gsteel gsteel merged commit 30a7ae7 into laminas:5.0.x Jul 24, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC Break Enhancement QA Quality assurance tasks such as static analysis improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants