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

@@ 361-381 (lines=21) @@
358
     * @param PaxSegRef[] $obFeeRefs
359
     * @return PricingOptionGroup[]
360
     */
361
    protected static function loadObFees($obFees, $obFeeRefs)
362
    {
363
        $opt = [];
364
365
        if (!empty($obFees)) {
366
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_OB_FEES);
367
368
            $po->penDisInformation = new PenDisInformation(
369
                PenDisInformation::QUAL_OB_FEES,
370
                $obFees
371
            );
372
373
            if (!empty($obFeeRefs)) {
374
                $po->paxSegTstReference = new PaxSegTstReference($obFeeRefs);
375
            }
376
377
            $opt[] = $po;
378
        }
379
380
        return $opt;
381
    }
382
383
    /**
384
     * @param string[] $paxDiscount
@@ 388-408 (lines=21) @@
385
     * @param PaxSegRef[] $paxDiscountCodeRefs
386
     * @return PricingOptionGroup[]
387
     */
388
    protected static function loadPaxDiscount($paxDiscount, $paxDiscountCodeRefs)
389
    {
390
        $opt = [];
391
392
        if (!empty($paxDiscount)) {
393
            $po = new PricingOptionGroup(PricingOptionKey::OPTION_PASSENGER_DISCOUNT_PTC);
394
395
            $po->penDisInformation = new PenDisInformation(
396
                PenDisInformation::QUAL_DISCOUNT,
397
                $paxDiscount
398
            );
399
400
            if (!empty($paxDiscountCodeRefs)) {
401
                $po->paxSegTstReference = new PaxSegTstReference($paxDiscountCodeRefs);
402
            }
403
404
            $opt[] = $po;
405
        }
406
407
        return $opt;
408
    }
409
410
    /**
411
     * @param string|null $posOverride