Code Duplication    Length = 25-25 lines in 2 locations

src/Amadeus/Client/Struct/Ticket/RepricePnrWithBookingClass.php 1 location

@@ 335-359 (lines=25) @@
332
     * @param FareBasis[] $pricingsFareBasis
333
     * @return PricingOption[]
334
     */
335
    protected function makePricingOptionFareBasisOverride($pricingsFareBasis)
336
    {
337
        $opt = [];
338
339
        if ($pricingsFareBasis !== null) {
340
            foreach ($pricingsFareBasis as $pricingFareBasis) {
341
                $po = new PricingOption(PricingOptionKey::OPTION_FARE_BASIS_SIMPLE_OVERRIDE);
342
343
                //Support for legacy fareBasisPrimaryCode to be removed when breaking BC:
344
                $po->optionDetail = new OptionDetail(
345
                    $pricingFareBasis->fareBasisPrimaryCode.$pricingFareBasis->fareBasisCode
346
                );
347
348
                //Support for legacy segmentReference to be removed when breaking BC:
349
                $po->paxSegTstReference = new PaxSegTstReference(
350
                    $pricingFareBasis->references,
351
                    $pricingFareBasis->segmentReference
352
                );
353
354
                $opt[] = $po;
355
            }
356
        }
357
358
        return $opt;
359
    }
360
361
    /**
362
     * @param Tax[] $taxes

src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php 1 location

@@ 278-302 (lines=25) @@
275
     * @param FareBasis[] $pricingsFareBasis
276
     * @return PricePnr13\PricingOptionGroup[]
277
     */
278
    protected static function makePricingOptionFareBasisOverride($pricingsFareBasis)
279
    {
280
        $opt = [];
281
282
        if ($pricingsFareBasis !== null) {
283
            foreach ($pricingsFareBasis as $pricingFareBasis) {
284
                $po = new PricingOptionGroup(PricingOptionKey::OPTION_FARE_BASIS_SIMPLE_OVERRIDE);
285
286
                //Support for legacy fareBasisPrimaryCode to be removed when breaking BC:
287
                $po->optionDetail = new OptionDetail(
288
                    $pricingFareBasis->fareBasisPrimaryCode.$pricingFareBasis->fareBasisCode
289
                );
290
291
                //Support for legacy segmentReference to be removed when breaking BC:
292
                $po->paxSegTstReference = new PaxSegTstReference(
293
                    $pricingFareBasis->references,
294
                    $pricingFareBasis->segmentReference
295
                );
296
297
                $opt[] = $po;
298
            }
299
        }
300
301
        return $opt;
302
    }
303
304
    /**
305
     * Load fare-family pricing option and return it.