Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Priority for hook methods #5890

Merged

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Jul 3, 2024

fixes #5889

I've introduced two new classes:

  • PHPUnit\Metadata\Api\HookMethod: which is a value object with method's name and its priority
  • PHPUnit\Metadata\Api\HookMethodsCollection which holds a collection of HookMethods, and will return methods as string with the right priority when iterating on it

HookMethods::hookMethods() will now return an array of HookCollections, and the handling of the priority will be delegated to this class.

BTW, I'm not really sure that PHPUnit\Metadata\Api\ is the right namespace for those classes.

@sebastianbergmann sebastianbergmann added type/enhancement A new idea that should be implemented feature/test-runner CLI test runner labels Jul 4, 2024
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.20%. Comparing base (7af36fe) to head (1b94f00).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5890      +/-   ##
============================================
+ Coverage     94.17%   94.20%   +0.02%     
- Complexity     6597     6632      +35     
============================================
  Files           700      708       +8     
  Lines         19883    19980      +97     
============================================
+ Hits          18725    18822      +97     
  Misses         1158     1158              

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

@nikophil nikophil force-pushed the feat/priority-in-hooks branch 3 times, most recently from f67762a to 5dacc85 Compare July 10, 2024 08:20
@nikophil nikophil marked this pull request as ready for review July 10, 2024 08:21
@sebastianbergmann sebastianbergmann changed the title feat: introduce priority for hook methods Priority for hook methods Jul 16, 2024
@nikophil nikophil force-pushed the feat/priority-in-hooks branch 3 times, most recently from 1576526 to 77de942 Compare July 18, 2024 06:46
@sebastianbergmann sebastianbergmann self-assigned this Jul 26, 2024
@sebastianbergmann sebastianbergmann added this to the PHPUnit 11.3 milestone Jul 26, 2024
@sebastianbergmann sebastianbergmann merged commit 2aa61b9 into sebastianbergmann:main Jul 26, 2024
23 checks passed
@sebastianbergmann
Copy link
Owner

Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a priority for hooks
2 participants