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

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