Code Duplication    Length = 12-14 lines in 6 locations

src/Amadeus/Client/Struct/Ticket/RepricePnrWithBookingClass.php 1 location

@@ 498-511 (lines=14) @@
495
     * @param string|null $waiverCode
496
     * @return PricingOption[]
497
     */
498
    protected function loadWaiverCode($waiverCode)
499
    {
500
        $opt = [];
501
502
        if (!empty($waiverCode)) {
503
            $po = new PricingOption(PricingOptionKey::OPTION_WAIVER_OPTION);
504
505
            $po->optionDetail = new OptionDetail($waiverCode);
506
507
            $opt[] = $po;
508
        }
509
510
        return $opt;
511
    }
512
513
    /**
514
     * @param PaxSegRef[] $overrideReusableAmountRefs

src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php 5 locations

@@ 329-342 (lines=14) @@
326
     * @param string|null $corporateNegoFare
327
     * @return PricingOptionGroup[]
328
     */
329
    protected static function loadCorpNegoFare($corporateNegoFare)
330
    {
331
        $opt = [];
332
333
        if ($corporateNegoFare !== null) {
334
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_CORPORATE_NEGOTIATED_FARES);
335
336
            $po->optionDetail = new OptionDetail($corporateNegoFare);
337
338
            $opt[] = $po;
339
        }
340
341
        return $opt;
342
    }
343
344
    /**
345
     * Load corporate unifares
@@ 480-491 (lines=12) @@
477
     * @param string|null $pricingLogic
478
     * @return PricingOptionGroup[]
479
     */
480
    protected static function loadPricingLogic($pricingLogic)
481
    {
482
        $opt = [];
483
484
        if (!empty($pricingLogic)) {
485
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_PRICING_LOGIC);
486
            $po->optionDetail = new OptionDetail($pricingLogic);
487
            $opt[] = $po;
488
        }
489
490
        return $opt;
491
    }
492
493
    /**
494
     * @param string|null $ticketType
@@ 497-510 (lines=14) @@
494
     * @param string|null $ticketType
495
     * @return PricingOptionGroup[]
496
     */
497
    protected static function loadTicketType($ticketType)
498
    {
499
        $opt = [];
500
501
        if (!empty($ticketType)) {
502
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_TICKET_TYPE);
503
504
            $po->optionDetail = new OptionDetail($ticketType);
505
506
            $opt[] = $po;
507
        }
508
509
        return $opt;
510
    }
511
512
    /**
513
     * @param Tax[] $taxes
@@ 591-604 (lines=14) @@
588
     * @param FormOfPayment[] $formOfPayment
589
     * @return PricingOptionGroup[]
590
     */
591
    protected static function loadFormOfPayment($formOfPayment)
592
    {
593
        $opt = [];
594
595
        if (!empty($formOfPayment)) {
596
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_FORM_OF_PAYMENT);
597
598
            $po->formOfPaymentInformation = new FormOfPaymentInformation($formOfPayment);
599
600
            $opt[] = $po;
601
        }
602
603
        return $opt;
604
    }
605
606
    /**
607
     * @param PaxSegRef[] $references
@@ 610-623 (lines=14) @@
607
     * @param PaxSegRef[] $references
608
     * @return PricingOptionGroup[]
609
     */
610
    protected static function loadReferences($references)
611
    {
612
        $opt = [];
613
614
        if (!empty($references)) {
615
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_PAX_SEGMENT_TST_SELECTION);
616
617
            $po->paxSegTstReference = new PaxSegTstReference($references);
618
619
            $opt[] = $po;
620
        }
621
622
        return $opt;
623
    }
624
625
    /**
626
     * Load ZAP-Off