File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed
Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 55namespace Kiboko \Component \Flow \Magento2 ;
66
77use Kiboko \Component \Bucket \AcceptanceResultBucket ;
8+ use Kiboko \Component \Bucket \RejectionResultBucket ;
89use Kiboko \Contract \Bucket \ResultBucketInterface ;
10+ use Kiboko \Magento \V2_1 \Model \CustomerDataCustomerInterface ;
11+ use Kiboko \Magento \V2_1 \Model \CustomerDataCustomerSearchResultsInterface ;
912
1013final class CustomerExtractor implements \Kiboko \Contract \Pipeline \ExtractorInterface
1114{
@@ -41,6 +44,14 @@ public function extract(): iterable
4144 queryParameters: $ this ->compileQueryParameters (),
4245 );
4346
47+ if (!$ response instanceof \Kiboko \Magento \V2_1 \Model \SalesDataOrderSearchResultInterface
48+ || !$ response instanceof \Kiboko \Magento \V2_2 \Model \SalesDataOrderSearchResultInterface
49+ || !$ response instanceof \Kiboko \Magento \V2_3 \Model \SalesDataOrderSearchResultInterface
50+ || !$ response instanceof \Kiboko \Magento \V2_4 \Model \SalesDataOrderSearchResultInterface
51+ ) {
52+ return ;
53+ }
54+
4455 yield $ this ->processResponse ($ response );
4556
4657 $ currentPage = 1 ;
@@ -64,7 +75,7 @@ private function processResponse($response): ResultBucketInterface
6475 || $ response instanceof \Kiboko \Magento \V2_3 \Model \ErrorResponse
6576 || $ response instanceof \Kiboko \Magento \V2_4 \Model \ErrorResponse
6677 ) {
67- throw new \ RuntimeException ($ response-> getMessage (), previous: [ ' exception ' => $ response ] );
78+ return new RejectionResultBucket ($ response );
6879 }
6980
7081 return new AcceptanceResultBucket (...$ response ->getItems ());
Original file line number Diff line number Diff line change 55namespace Kiboko \Component \Flow \Magento2 ;
66
77use Kiboko \Component \Bucket \AcceptanceResultBucket ;
8+ use Kiboko \Component \Bucket \RejectionResultBucket ;
89use Kiboko \Contract \Bucket \ResultBucketInterface ;
910
1011final class OrderExtractor implements \Kiboko \Contract \Pipeline \ExtractorInterface
@@ -38,6 +39,14 @@ public function extract(): iterable
3839 queryParameters: $ this ->compileQueryParameters (),
3940 );
4041
42+ if (!$ response instanceof \Kiboko \Magento \V2_1 \Model \CustomerDataCustomerSearchResultsInterface
43+ || !$ response instanceof \Kiboko \Magento \V2_2 \Model \CustomerDataCustomerSearchResultsInterface
44+ || !$ response instanceof \Kiboko \Magento \V2_3 \Model \CustomerDataCustomerSearchResultsInterface
45+ || !$ response instanceof \Kiboko \Magento \V2_4 \Model \CustomerDataCustomerSearchResultsInterface
46+ ) {
47+ return ;
48+ }
49+
4150 yield $ this ->processResponse ($ response );
4251
4352 $ currentPage = 1 ;
@@ -61,7 +70,7 @@ private function processResponse($response): ResultBucketInterface
6170 || $ response instanceof \Kiboko \Magento \V2_3 \Model \ErrorResponse
6271 || $ response instanceof \Kiboko \Magento \V2_4 \Model \ErrorResponse
6372 ) {
64- throw new \ RuntimeException ($ response-> getMessage (), previous: [ ' exception ' => $ response ] );
73+ return new RejectionResultBucket ($ response );
6574 }
6675
6776 return new AcceptanceResultBucket (...$ response ->getItems ());
Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ public function extract(): iterable
3939 queryParameters: $ this ->compileQueryParameters (),
4040 );
4141
42+ if (!$ response instanceof \Kiboko \Magento \V2_1 \Model \CatalogDataProductSearchResultsInterface
43+ || !$ response instanceof \Kiboko \Magento \V2_2 \Model \CatalogDataProductSearchResultsInterface
44+ || !$ response instanceof \Kiboko \Magento \V2_3 \Model \CatalogDataProductSearchResultsInterface
45+ || !$ response instanceof \Kiboko \Magento \V2_4 \Model \CatalogDataProductSearchResultsInterface
46+ ) {
47+ return ;
48+ }
49+
4250 yield $ this ->processResponse ($ response );
4351
4452 $ currentPage = 1 ;
@@ -62,7 +70,7 @@ private function processResponse($response): ResultBucketInterface
6270 || $ response instanceof \Kiboko \Magento \V2_3 \Model \ErrorResponse
6371 || $ response instanceof \Kiboko \Magento \V2_4 \Model \ErrorResponse
6472 ) {
65- throw new \ RuntimeException ($ response-> getMessage (), previous: [ ' exception ' => $ response ] );
73+ return new RejectionResultBucket ($ response );
6674 }
6775
6876 return new AcceptanceResultBucket (...$ response ->getItems ());
You can’t perform that action at this time.
0 commit comments