Skip to content

PHPStan Wave 1: Quick wins (30 errors) - #46

Merged
benrowe merged 4 commits into
masterfrom
feature/issue-36-remove-baseline-1
Dec 13, 2025
Merged

benrowe merged 4 commits into
masterfrom
feature/issue-36-remove-baseline-1

Conversation

@benrowe

@benrowe benrowe commented Dec 13, 2025

Copy link
Copy Markdown
Collaborator

Summary

Fixed Wave 1 PHPStan errors - the "quick wins" totaling 30 errors. This reduces the baseline from 145 to 115 errors.

Errors Fixed

  1. PHPDoc Syntax Errors (3 errors) - Fixed invalid @SuppressWarnings syntax in Event.php, EventOrchestrator.php, LockManager.php
  2. Serializer Return Type Errors (4 errors) - Fixed return type mismatches in TransitionContextSerializer.php by ensuring sequential integer keys
  3. Assertion Tautologies (12 errors) - Removed redundant type assertions that were always true
  4. Null Safety Errors (11 errors) - Added proper null checks before accessing array element properties

Files Modified

Source files (7 errors fixed):

  • src/Events/Event.php
  • src/Events/EventOrchestrator.php
  • src/Locking/LockManager.php
  • src/TransitionContextSerializer.php

Test files (23 errors fixed):

  • Multiple collection, integration, and serialization test files

Testing Performed

✅ make check passes completely
✅ 401 tests passing with 1314 assertions
✅ 100% code coverage maintained
✅ No lint issues
✅ PHPStan analysis passes with baseline

Baseline Error Count

  • Before: 145 errors
  • After: 115 errors
  • Fixed: 30 errors

Related

Closes part of #36


🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

benrowe and others added 4 commits December 14, 2025 08:33
- Fix @SuppressWarnings PHPDoc syntax by quoting values
- Add array_values() to ensure int-indexed arrays in serializers
- Resolves 7 PHPStan errors (phpDoc.parseError and return.type)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove assertIsArray where toArray() always returns array
- Remove assertIsString where serialize() always returns string
- Remove assertIsFloat where timestamp is always float
- Resolves 12 PHPStan method.alreadyNarrowedType errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add assertNotNull after array access in integration tests
- Extract array elements to variables before property access
- Resolves 11 PHPStan property.nonObject errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Reduced baseline from 145 to 115 errors (30 errors fixed):
- 3 PHPDoc syntax errors (phpDoc.parseError)
- 4 serializer return type errors (return.type)
- 12 assertion tautology errors (method.alreadyNarrowedType)
- 11 null safety errors (property.nonObject)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@benrowe
benrowe merged commit ffc4cf0 into master Dec 13, 2025
8 checks passed
@benrowe
benrowe deleted the feature/issue-36-remove-baseline-1 branch December 13, 2025 21:36
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.

1 participant