@@ -416,17 +416,13 @@ public function getOperatorsByCountryIso(string $countryIso, bool $suggestedAmou
416416 $ operators = [];
417417
418418 if ($ response != null && $ response ->getContent () != null ) {
419- foreach ($ response ->getContent () as $ jsonCollection ) {
420419
421- if (! is_array ( $ jsonCollection ) ) {
420+ foreach ( $ response -> getContent () as $ operatorsResponse ) {
422421
423- $ operators [] = Operator:: fromResponseData ( $ jsonCollection ) ;
422+ if (! is_array ( $ operatorsResponse )) continue ;
424423
425- }
426- else {
427- foreach ($ jsonCollection as $ json ) {
428- $ operators [] = Operator::fromResponseData ($ json );
429- }
424+ foreach ($ operatorsResponse as $ data ) {
425+ $ operators [] = Operator::fromResponseData ($ data );
430426 }
431427 }
432428 }
@@ -452,17 +448,12 @@ public function getPromotions(int $page = 1, int $size = 50) : ?array {
452448 $ promotions = [];
453449
454450 if ($ response != null && $ response ->getContent () != null ) {
455- foreach ($ response ->getContent () as $ jsonCollection ) {
456-
457- if (!is_array ($ jsonCollection )) {
451+ foreach ($ response ->getContent () as $ promotionsResponse ) {
458452
459- $ promotions [] = Promotion:: fromResponseData ( $ jsonCollection ) ;
453+ if (! is_array ( $ promotionsResponse )) continue ;
460454
461- }
462- else {
463- foreach ($ jsonCollection as $ json ) {
464- $ promotions [] = Promotion::fromResponseData ($ json );
465- }
455+ foreach ($ promotionsResponse as $ data ) {
456+ $ promotions [] = Promotion::fromResponseData ($ data );
466457 }
467458 }
468459 }
@@ -482,11 +473,11 @@ public function getPromotionsByCountryIso(string $country_iso) : ?array {
482473 $ promotions = [];
483474
484475 if ($ response != null && $ response ->getContent () != null ) {
485- foreach ($ response ->getContent () as $ jsonCollection ) {
486- if (!is_array ($ jsonCollection )) continue ;
476+ foreach ($ response ->getContent () as $ promotionsResponse ) {
477+ if (!is_array ($ promotionsResponse )) continue ;
487478
488- foreach ($ jsonCollection as $ json ) {
489- $ promotions [] = Promotion::fromResponseData ($ json );
479+ foreach ($ promotionsResponse as $ data ) {
480+ $ promotions [] = Promotion::fromResponseData ($ data );
490481 }
491482 }
492483 }
@@ -506,11 +497,11 @@ public function getPromotionsByOperator(int $operator_id) : ?array {
506497 $ promotions = [];
507498
508499 if ($ response != null && $ response ->getContent () != null ) {
509- foreach ($ response ->getContent () as $ jsonCollection ) {
510- if (!is_array ($ jsonCollection )) continue ;
500+ foreach ($ response ->getContent () as $ promotionsResponse ) {
501+ if (!is_array ($ promotionsResponse )) continue ;
511502
512- foreach ($ jsonCollection as $ json ) {
513- $ promotions [] = Promotion::fromResponseData ($ json );
503+ foreach ($ promotionsResponse as $ data ) {
504+ $ promotions [] = Promotion::fromResponseData ($ data );
514505 }
515506 }
516507 }
@@ -552,12 +543,11 @@ public function getTransactions(DateTimeInterface $start_date_time, DateTimeInte
552543 $ transactions = [];
553544
554545 if ($ response != null && $ response ->getContent () != null ) {
555- foreach ($ response ->getContent () as $ jsonCollection ) {
556-
557- if (!is_array ($ jsonCollection )) continue ;
546+ foreach ($ response ->getContent () as $ transactionsResponse ) {
547+ if (!is_array ($ transactionsResponse )) continue ;
558548
559- foreach ($ jsonCollection as $ json ) {
560- $ transactions [] = Transaction::fromResponseData ($ json );
549+ foreach ($ transactionsResponse as $ data ) {
550+ $ transactions [] = Transaction::fromResponseData ($ data );
561551 }
562552 }
563553 }
0 commit comments