Skip to content

Use sebastian/version-requirement#6765

Draft
sebastianbergmann wants to merge 2 commits into
mainfrom
refactor/version-requirement
Draft

Use sebastian/version-requirement#6765
sebastianbergmann wants to merge 2 commits into
mainfrom
refactor/version-requirement

Conversation

@sebastianbergmann

Copy link
Copy Markdown
Owner

@sebastianbergmann sebastianbergmann added this to the PHPUnit 13.3 milestone Jun 20, 2026
@sebastianbergmann sebastianbergmann self-assigned this Jun 20, 2026
@sebastianbergmann sebastianbergmann added the type/refactoring A refactoring that should be applied to make the code easier to understand and maintain label Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

API Surface Changes

If any of the additions below are not intended as public API, mark them with @internal in the docblock.

Removed API Surface

Methods

Modified API Surface

Methods

@sebastianbergmann sebastianbergmann force-pushed the main branch 2 times, most recently from 7697ee1 to ea25442 Compare June 20, 2026 11:37
@sebastianbergmann sebastianbergmann force-pushed the refactor/version-requirement branch from 2f7c953 to 574fb63 Compare June 20, 2026 11:47
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.65%. Comparing base (ea25442) to head (6617292).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Metadata/Api/Requirements.php 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6765      +/-   ##
============================================
- Coverage     97.65%   97.65%   -0.01%     
+ Complexity     8969     8966       -3     
============================================
  Files           881      881              
  Lines         27565    27553      -12     
============================================
- Hits          26919    26906      -13     
- Misses          646      647       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

The version-requirement parsing, operator validation, and satisfaction checking are delegated to sebastian/version-requirement, but the package is fully encapsulated behind PHPUnit-owned value objects.

The value objects exposed through events (Requirement and its subtypes via test metadata, VersionComparisonOperator via the configuration) are now pure data transfer objects: they hold only scalar values, aggregate no objects from the package, and carry no behavior. The satisfaction check (isSatisfiedBy()) has moved to Metadata\Api\Requirements, which is where the package is used. As the value objects no longer hold package objects, they serialize cleanly across separate-process test runs.

The package is referenced at exactly three boundaries: Requirement::from() (parsing), VersionComparisonOperator (operator validation), and Requirements::isSatisfiedBy() (satisfaction checking). Package exceptions are converted to PHPUnit exceptions at those boundaries so they do not leak either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/refactoring A refactoring that should be applied to make the code easier to understand and maintain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant