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

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