File tree Expand file tree Collapse file tree 1 file changed +30
-11
lines changed
Expand file tree Collapse file tree 1 file changed +30
-11
lines changed Original file line number Diff line number Diff line change 44
55namespace Kiboko \Component \Pipeline ;
66
7+ use Kiboko \Component \Bucket \RejectionResultBucket ;
8+ use Kiboko \Component \Bucket \RejectionWithReasonResultBucket ;
79use Kiboko \Contract \Bucket \AcceptanceResultBucketInterface ;
810use Kiboko \Contract \Bucket \RejectionResultBucketInterface ;
911use Kiboko \Contract \Bucket \ResultBucketInterface ;
@@ -44,17 +46,34 @@ public function run(
4446 }
4547
4648 if ($ bucket instanceof RejectionResultBucketInterface) {
47- foreach ($ bucket ->walkRejection () as $ line ) {
48- $ rejection ->reject ($ line );
49- $ state ->reject ();
50-
51- $ this ->logger ->log (
52- $ this ->rejectionLevel ,
53- 'Some data was rejected from the pipeline ' ,
54- [
55- 'line ' => $ line ,
56- ]
57- );
49+ if ($ bucket instanceof RejectionResultBucket) {
50+ foreach ($ bucket ->walkRejection () as $ line ) {
51+ $ rejection ->reject ($ line );
52+ $ state ->reject ();
53+
54+ $ this ->logger ->log (
55+ $ this ->rejectionLevel ,
56+ 'Some data was rejected from the pipeline ' ,
57+ [
58+ 'line ' => $ line ,
59+ ]
60+ );
61+ }
62+ }
63+
64+ if ($ bucket instanceof RejectionWithReasonResultBucket) {
65+ foreach ($ bucket ->walkRejection () as $ line ) {
66+ $ rejection ->rejectWithReason ($ line , $ bucket ->getReason ());
67+ $ state ->reject ();
68+
69+ $ this ->logger ->log (
70+ $ this ->rejectionLevel ,
71+ 'Some data was rejected from the pipeline ' ,
72+ [
73+ 'line ' => $ line ,
74+ ]
75+ );
76+ }
5877 }
5978 }
6079
You can’t perform that action at this time.
0 commit comments