Skip to content

Conversation

@k2gl
Copy link
Owner

@k2gl k2gl commented Jan 21, 2026

Summary

This PR adds 45 new assertion methods across 8 traits, improves code organization, integrates PHPStan static analysis, updates CI for PHP 8.1-8.4, and enhances documentation.

Changes

  • New Methods: Added 45 assertion methods (numeric, string, array, boolean, null, type checking, special).
  • Traits: Split methods into logical traits for better maintainability.
  • Static Analysis: Integrated PHPStan with configs.
  • Test Organization: Added categorized test suites in phpunit.xml.
  • Docs: Fixed PHPDoc, updated README with examples, enforced AGENTS.md guidelines.

Testing

  • 382 tests added, all passing (753 assertions).
  • PHPStan integrated, critical issues resolved.
  • CI tests all PHP versions.

Validation

  • All tests pass.
  • Static analysis clean (minor expected warnings).
  • Follows AGENTS.md requirements.

k2gl added 17 commits January 22, 2026 03:09
- Added isNotEmptyArray() to ArrayAssertions trait
- Created comprehensive unit tests
- Updated README.md with usage example
- Complies with AGENTS.md requirements
…ng of assertion methods'

- Changed @return self descriptions across all traits and main class
- Based on PHPDoc consistency analysis from ArrayAssertions changes
- Unified @return descriptions to 'Enables fluent chaining of assertion methods'
- Applied changes to all 8 traits for codebase uniformity
- Added runtime checks for empty prefix/suffix strings
- Ensures PHPUnit assertions receive non-empty strings as expected
- Maintains library flexibility while satisfying static analysis
- Changed startsWith and endsWith parameter types to non-empty-string
- Ensures static analysis recognizes non-empty string requirements
- Runtime checks already enforce this, now reflected in types
… strlen() and update PHPDoc for startsWith/endsWith params to string
…types, fixed @return types, added @var assertions for Psalm type safety
@k2gl k2gl merged commit 60276da into main Jan 21, 2026
1 check passed
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