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

@@ 393-413 (lines=21) @@
390
     * @param PaxSegRef[] $obFeeRefs
391
     * @return PricingOptionGroup[]
392
     */
393
    protected static function loadObFees($obFees, $obFeeRefs)
394
    {
395
        $opt = [];
396
397
        if (!empty($obFees)) {
398
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_OB_FEES);
399
400
            $po->penDisInformation = new PenDisInformation(
401
                PenDisInformation::QUAL_OB_FEES,
402
                $obFees
403
            );
404
405
            if (!empty($obFeeRefs)) {
406
                $po->paxSegTstReference = new PaxSegTstReference($obFeeRefs);
407
            }
408
409
            $opt[] = $po;
410
        }
411
412
        return $opt;
413
    }
414
415
    /**
416
     * @param string[] $paxDiscount
@@ 420-440 (lines=21) @@
417
     * @param PaxSegRef[] $paxDiscountCodeRefs
418
     * @return PricingOptionGroup[]
419
     */
420
    protected static function loadPaxDiscount($paxDiscount, $paxDiscountCodeRefs)
421
    {
422
        $opt = [];
423
424
        if (!empty($paxDiscount)) {
425
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_PASSENGER_DISCOUNT_PTC);
426
427
            $po->penDisInformation = new PenDisInformation(
428
                PenDisInformation::QUAL_DISCOUNT,
429
                $paxDiscount
430
            );
431
432
            if (!empty($paxDiscountCodeRefs)) {
433
                $po->paxSegTstReference = new PaxSegTstReference($paxDiscountCodeRefs);
434
            }
435
436
            $opt[] = $po;
437
        }
438
439
        return $opt;
440
    }
441
442
    /**
443
     * @param string|null $posOverride