Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add pipeline interceptor #370

Merged
merged 8 commits into from
Dec 22, 2020
Merged

Add pipeline interceptor #370

merged 8 commits into from
Dec 22, 2020

Conversation

vvval
Copy link
Member

@vvval vvval commented Dec 18, 2020

  • add pipeline interceptor

This interceptor can be assigned on a separate method with its own interceptors pipeline (ordered and/or filtered). It can totally remove any other interceptors after it (so it should be added 1st to the domain core) or just unshift any other interceptors into the pipeline.

    /**
     * @Pipeline(pipeline={OtherInterceptor::class})
     * @return mixed
     */
    public function action(){}

IN DRAFT:

  • missing tests

  • need to ignore duplicated interceptors (if skipNext is false)

Doc:

  • Pipeline can be used to override the interceptors set, to do so you need to add pipeline interceptor as the 1st one in the bootloaders and set skipNext=true in the annotation.
  • Pipeline can be used to inject additional interceptors directly into the original set on the position of the pipeline interceptor

@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #370 (4d4d5c9) into master (cb9e087) will increase coverage by 0.15%.
The diff coverage is 95.34%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #370      +/-   ##
============================================
+ Coverage     91.17%   91.33%   +0.15%     
- Complexity     8038     8124      +86     
============================================
  Files          1106     1111       +5     
  Lines         27107    27418     +311     
============================================
+ Hits          24716    25041     +325     
+ Misses         2391     2377      -14     
Impacted Files Coverage Δ Complexity Δ
...ework/Bootloader/Security/ValidationBootloader.php 100.00% <ø> (ø) 5.00 <0.00> (ø)
src/Validation/tests/BaseTest.php 100.00% <ø> (ø) 3.00 <0.00> (ø)
src/Framework/Domain/PipelineInterceptor.php 89.47% <89.47%> (ø) 23.00 <23.00> (?)
src/Validation/src/AbstractValidator.php 100.00% <100.00%> (ø) 18.00 <18.00> (?)
src/Validation/src/Checker/TypeChecker.php 100.00% <100.00%> (ø) 15.00 <6.00> (+6.00)
src/Validation/src/Validator.php 100.00% <100.00%> (ø) 8.00 <0.00> (-15.00)
src/Validation/tests/Checkers/TypesTest.php 100.00% <100.00%> (ø) 8.00 <1.00> (+1.00)
src/Validation/tests/MessagesTest.php 100.00% <100.00%> (ø) 6.00 <1.00> (+1.00)
src/Core/tests/InjectableConfigTest.php 83.33% <0.00%> (-1.78%) 8.00% <0.00%> (ø%)
src/Models/tests/SchematicEntityTest.php 77.77% <0.00%> (-1.30%) 6.00% <0.00%> (ø%)
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba27682...4d4d5c9. Read the comment docs.

@vvval vvval merged commit 48358c7 into master Dec 22, 2020
@SerafimArts SerafimArts deleted the add_pipeline_interceptor branch July 22, 2021 10:23
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.

None yet

3 participants