refactor: improve DRY and add pre-PR checklist #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements improvements identified in the Issue #50 comprehensive review (docs/PR_REVIEW_ISSUE50.md).
Improvements:
Changes
1. Extract Magic Constants in
TenantKeyBefore:
After:
Benefit: Improves maintainability and makes intent explicit.
2. Use
NormalizesPersonFieldsTrait inRebuildIndexCommandBefore:
After:
Benefit: Eliminates code duplication, ensures consistent normalization logic across PersonObserver, PersonRepository, and RebuildIndexCommand.
3. Add Pre-PR Quality Checklist to
DEVELOPMENT.mdAdded comprehensive checklist covering:
Quick Pre-PR Command:
Benefit: Documents best practices learned from Issue #50, prevents future follow-up PRs for avoidable issues.
Metrics
TenantKey.php: +8 LOC (2 constants)RebuildIndexCommand.php: +3 LOC (use trait, remove duplication)DEVELOPMENT.md: +101 LOC (Pre-PR checklist)Review Impact
These changes address recommendations from Issue #50 comprehensive review:
Testing
All existing tests pass without modification - refactoring is transparent to behavior.
Checklist
Related