Skip to content

Conversation

@stmh
Copy link
Member

@stmh stmh commented Dec 24, 2025

No description provided.

renovate bot and others added 2 commits December 1, 2025 09:37
- Update PHP requirement from ^8.2 to ^8.3 (PHPUnit 12 requires PHP 8.3+)
- Replace deprecated setMethods() with onlyMethods() in test files
- Replace $this->returnValue() with willReturn() in test files
- Add :void return type to CompletionCommand::configure()
- Fix compiler passes to skip abstract class definitions
- Exclude abstract Method classes from services auto-registration
@claude
Copy link

claude bot commented Dec 24, 2025

Pull Request Review: PHPUnit 12 Upgrade

Summary

This PR upgrades PHPUnit from v9 to v12, which is a major version upgrade requiring PHP 8.3+. The changes are well-structured and address the necessary compatibility requirements.


✅ Code Quality & Best Practices

Positive aspects:

  • Clean migration from deprecated PHPUnit methods (setMethods() → onlyMethods(), returnValue() → willReturn())
  • Consistent application of changes across all test files
  • Proper addition of return type (void) to CompletionCommand::configure() method
  • Appropriate exclusion of abstract classes from dependency injection auto-registration

🐛 Potential Issues

  1. CompletionCommand logic flaw (src/Command/CompletionCommand.php:96):

    • Line 96 has if (argument) instead of elseif (argument)
    • This appears to be a pre-existing bug where both option and argument handlers could execute
    • Not introduced by this PR, but worth noting
  2. Compiler pass robustness:

    • The added isAbstract() checks are good
    • Current null-safety implementation looks correct with existing class checks

🔒 Security Considerations

No security concerns identified. Changes are:

  • Dependency updates (composer.lock)
  • Test compatibility fixes
  • Internal framework configuration

⚡ Performance Considerations

  • PHP 8.3 includes performance improvements over 8.2
  • PHPUnit 12 is generally faster than v9
  • No code changes that would negatively impact runtime performance

Recommendation: Update CI/CD pipelines to use PHP 8.3+ before merging.


🧪 Test Coverage

Changes to test files:

  • ✅ All mock builder calls updated consistently
  • ✅ Return value syntax modernized
  • ✅ Type hints added where appropriate

Recommendations:

  1. Run the full test suite: ./vendor/bin/phpunit
  2. Run static analysis: ./vendor/bin/phpstan analyze src/ --level=4
  3. Verify GrumPHP passes: ./vendor/bin/grumphp run

📋 Breaking Changes

⚠️ This PR introduces breaking changes:

  • Minimum PHP version: 8.2 → 8.3
  • Minimum PHPUnit version: 9.3 → 12.0

Migration path:

  1. Update development environments to PHP 8.3+
  2. Update CI/CD pipelines to PHP 8.3+
  3. Update deployment documentation if applicable
  4. Consider adding a note in CHANGELOG.md

📝 Documentation

Suggested additions:

  1. Update README.md if it specifies PHP version requirements
  2. Add an entry to CHANGELOG.md documenting this upgrade
  3. Consider updating .github/workflows if they reference specific PHP versions

✨ Overall Assessment

Rating: Approve with minor suggestions

This is a solid, well-executed dependency upgrade. The changes are:

  • ✅ Consistent and complete
  • ✅ Follow PHPUnit 12 migration guidelines
  • ✅ Include necessary infrastructure changes (DI container fixes)
  • ✅ Update dependencies appropriately

Recommendation: Merge after running the test suite and updating relevant documentation.

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.

3 participants