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

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