Code Duplication    Length = 21-21 lines in 3 locations

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

@@ 437-457 (lines=21) @@
434
     * @param PaxSegRef[] $paxDiscountCodeRefs
435
     * @return PricingOption[]
436
     */
437
    protected function loadPaxDiscount($paxDiscount, $paxDiscountCodeRefs)
438
    {
439
        $opt = [];
440
441
        if (!empty($paxDiscount)) {
442
            $po = new PricingOption(PricingOptionKey::OPTION_PASSENGER_DISCOUNT_PTC);
443
444
            $po->penDisInformation = new PenDisInformation(
445
                PenDisInformation::QUAL_DISCOUNT,
446
                $paxDiscount
447
            );
448
449
            if (!empty($paxDiscountCodeRefs)) {
450
                $po->paxSegTstReference = new PaxSegTstReference($paxDiscountCodeRefs);
451
            }
452
453
            $opt[] = $po;
454
        }
455
456
        return $opt;
457
    }
458
459
    /**
460
     * @param string|null $posOverride

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

@@ 414-434 (lines=21) @@
411
     * @param PaxSegRef[] $obFeeRefs
412
     * @return PricingOptionGroup[]
413
     */
414
    protected static function loadObFees($obFees, $obFeeRefs)
415
    {
416
        $opt = [];
417
418
        if (!empty($obFees)) {
419
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_OB_FEES);
420
421
            $po->penDisInformation = new PenDisInformation(
422
                PenDisInformation::QUAL_OB_FEES,
423
                $obFees
424
            );
425
426
            if (!empty($obFeeRefs)) {
427
                $po->paxSegTstReference = new PaxSegTstReference($obFeeRefs);
428
            }
429
430
            $opt[] = $po;
431
        }
432
433
        return $opt;
434
    }
435
436
    /**
437
     * @param string[] $paxDiscount
@@ 441-461 (lines=21) @@
438
     * @param PaxSegRef[] $paxDiscountCodeRefs
439
     * @return PricingOptionGroup[]
440
     */
441
    protected static function loadPaxDiscount($paxDiscount, $paxDiscountCodeRefs)
442
    {
443
        $opt = [];
444
445
        if (!empty($paxDiscount)) {
446
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_PASSENGER_DISCOUNT_PTC);
447
448
            $po->penDisInformation = new PenDisInformation(
449
                PenDisInformation::QUAL_DISCOUNT,
450
                $paxDiscount
451
            );
452
453
            if (!empty($paxDiscountCodeRefs)) {
454
                $po->paxSegTstReference = new PaxSegTstReference($paxDiscountCodeRefs);
455
            }
456
457
            $opt[] = $po;
458
        }
459
460
        return $opt;
461
    }
462
463
    /**
464
     * @param string|null $posOverride