File tree Expand file tree Collapse file tree 1 file changed +29
-10
lines changed
Expand file tree Collapse file tree 1 file changed +29
-10
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 ;
@@ -43,17 +45,34 @@ public function run(
4345 }
4446
4547 if ($ bucket instanceof RejectionResultBucketInterface) {
46- foreach ($ bucket ->walkRejection () as $ line ) {
47- $ rejection ->reject ($ line );
48- $ state ->reject ();
48+ if ($ bucket instanceof RejectionResultBucket) {
49+ foreach ($ bucket ->walkRejection () as $ line ) {
50+ $ rejection ->reject ($ line );
51+ $ state ->reject ();
4952
50- $ this ->logger ->log (
51- $ this ->rejectionLevel ,
52- 'Some data was rejected from the pipeline ' ,
53- [
54- 'line ' => $ line ,
55- ]
56- );
53+ $ this ->logger ->log (
54+ $ this ->rejectionLevel ,
55+ 'Some data was rejected from the pipeline ' ,
56+ [
57+ 'line ' => $ line ,
58+ ]
59+ );
60+ }
61+ }
62+
63+ if ($ bucket instanceof RejectionWithReasonResultBucket) {
64+ foreach ($ bucket ->walkRejection () as $ line ) {
65+ $ rejection ->rejectWithReason ($ line , $ bucket ->getReason ());
66+ $ state ->reject ();
67+
68+ $ this ->logger ->log (
69+ $ this ->rejectionLevel ,
70+ 'Some data was rejected from the pipeline ' ,
71+ [
72+ 'line ' => $ line ,
73+ ]
74+ );
75+ }
5776 }
5877 }
5978
You can’t perform that action at this time.
0 commit comments