Completed
Push — develop ( a8f9d1...a75ab6 )
by Dieter
10:08 queued 04:43
created

Client::pnrDisplayHistory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 19
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 19
loc 19
rs 9.4285
cc 1
eloc 12
nc 1
nop 2
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus;
24
25
use Amadeus\Client\Exception;
26
use Amadeus\Client\Params;
27
use Amadeus\Client\RequestCreator\RequestCreatorInterface;
28
use Amadeus\Client\RequestOptions;
29
use Amadeus\Client\ResponseHandler\ResponseHandlerInterface;
30
use Amadeus\Client\Result;
31
use Amadeus\Client\Session\Handler\HandlerFactory;
32
use Amadeus\Client\RequestCreator\Factory as RequestCreatorFactory;
33
use Amadeus\Client\Session\Handler\HandlerInterface;
34
use Amadeus\Client\ResponseHandler\Base as ResponseHandlerBase;
35
36
/**
37
 * Amadeus Web Service Client.
38
 *
39
 * TODO:
40
 * - support older versions of SoapHeader (1)
41
 * - implement calls for full online booking flow:
42
 *      SalesReports_DisplayQueryReport
43
 *      Air_MultiAvailability
44
 *
45
 * - implement more PNR_AddMultiElements:
46
 *      OSI segment
47
 *
48
 * @package Amadeus
49
 * @author Dieter Devlieghere <[email protected]>
50
 */
51
class Client
52
{
53
    /**
54
     * Amadeus SOAP header version 1
55
     */
56
    const HEADER_V1 = "1";
57
    /**
58
     * Amadeus SOAP header version 2
59
     */
60
    const HEADER_V2 = "2";
61
    /**
62
     * Amadeus SOAP header version 4
63
     */
64
    const HEADER_V4 = "4";
65
66
    /**
67
     * Version string
68
     *
69
     * @var string
70
     */
71
    const version = "0.0.1dev";
72
    /**
73
     * An identifier string for the library (to be used in Received From entries)
74
     *
75
     * @var string
76
     */
77
    const receivedFromIdentifier = "amabnl-amadeus-ws-client";
78
79
    /**
80
     * Session Handler will be sending all the messages and handling all session-related things.
81
     *
82
     * @var HandlerInterface
83
     */
84
    protected $sessionHandler;
85
86
    /**
87
     * Request Creator is will create the correct message structure to send to the SOAP server.
88
     *
89
     * @var RequestCreatorInterface
90
     */
91
    protected $requestCreator;
92
93
    /**
94
     * Response Handler will check the received response for errors.
95
     *
96
     * @var ResponseHandlerInterface
97
     */
98
    protected $responseHandler;
99
100
    /**
101
     * Authentication parameters
102
     *
103
     * @var Params\AuthParams
104
     */
105
    protected $authParams;
106
107
    /**
108
     * Set the session as stateful (true) or stateless (false)
109
     *
110
     * @param bool $newStateful
111
     */
112
    public function setStateful($newStateful)
113
    {
114
        $this->sessionHandler->setStateful($newStateful);
115
    }
116
117
    /**
118
     * @return bool
119
     */
120
    public function isStateful()
121
    {
122
        return $this->sessionHandler->isStateful();
123
    }
124
125
    /**
126
     * Get the last raw XML message that was sent out
127
     *
128
     * @return string|null
129
     */
130
    public function getLastRequest()
131
    {
132
        return $this->sessionHandler->getLastRequest();
133
    }
134
135
    /**
136
     * Get the last raw XML message that was received
137
     *
138
     * @return string|null
139
     */
140
    public function getLastResponse()
141
    {
142
        return $this->sessionHandler->getLastResponse();
143
    }
144
145
    /**
146
     * Get session information for authenticated session
147
     *
148
     * - sessionId
149
     * - sequenceNr
150
     * - securityToken
151
     *
152
     * @return array|null
153
     */
154
    public function getSessionData()
155
    {
156
        return $this->sessionHandler->getSessionData();
157
    }
158
159
    /**
160
     * Restore a previously used session
161
     *
162
     * To be used when implementing your own session pooling system on legacy Soap Header 2 applications.
163
     *
164
     * @param array $sessionData
165
     * @return bool
166
     */
167
    public function setSessionData(array $sessionData)
168
    {
169
        return $this->sessionHandler->setSessionData($sessionData);
170
    }
171
172
    /**
173
     * Construct Amadeus Web Services client
174
     *
175
     * @param Params $params
176
     */
177
    public function __construct($params)
178
    {
179
        if ($params->authParams instanceof Params\AuthParams) {
180
            $this->authParams = $params->authParams;
181
            if (isset($params->sessionHandlerParams) && $params->sessionHandlerParams instanceof Params\SessionHandlerParams) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 127 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
182
                $params->sessionHandlerParams->authParams = $this->authParams;
183
            }
184
        }
185
186
        $this->sessionHandler = $this->loadSessionHandler(
187
            $params->sessionHandler,
188
            $params->sessionHandlerParams
0 ignored issues
show
Bug introduced by
It seems like $params->sessionHandlerParams can be null; however, loadSessionHandler() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
189
        );
190
191
        $this->requestCreator = $this->loadRequestCreator(
192
            $params->requestCreator,
193
            $params->requestCreatorParams,
194
            self::receivedFromIdentifier . "-" .self::version,
195
            $this->sessionHandler->getOriginatorOffice(),
196
            $this->sessionHandler->getMessagesAndVersions()
197
        );
198
199
        $this->responseHandler = $this->loadResponseHandler(
200
            $params->responseHandler
201
        );
202
    }
203
204
    /**
205
     * Authenticate.
206
     *
207
     * Parameters were provided at construction time (sessionhandlerparams)
208
     *
209
     * @return Result
210
     * @throws Exception
211
     */
212 View Code Duplication
    public function securityAuthenticate()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
213
    {
214
        $msgName = 'Security_Authenticate';
215
        $messageOptions = $this->makeMessageOptions([], false);
216
217
        $sendResult = $this->sessionHandler->sendMessage(
218
            $msgName,
219
            $this->requestCreator->createRequest(
220
                $msgName,
221
                new RequestOptions\SecurityAuthenticateOptions(
222
                    $this->authParams
223
                )
224
            ),
225
            $messageOptions
226
        );
227
228
        return $this->responseHandler->analyzeResponse(
229
            $sendResult,
230
            $msgName
231
        );
232
    }
233
234
    /**
235
     * Terminate a session - only applicable to non-stateless mode.
236
     *
237
     * @return Result
238
     * @throws Exception
239
     */
240 View Code Duplication
    public function securitySignOut()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
241
    {
242
        $msgName = 'Security_SignOut';
243
        $messageOptions = $this->makeMessageOptions([], true);
244
245
        $sendResult = $this->sessionHandler->sendMessage(
246
            $msgName,
247
            $this->requestCreator->createRequest(
248
                $msgName,
249
                new RequestOptions\SecuritySignOutOptions()
250
            ),
251
            $messageOptions
252
        );
253
254
        return $this->responseHandler->analyzeResponse(
255
            $sendResult,
256
            $msgName
257
        );
258
    }
259
260
    /**
261
     * PNR_Retrieve - Retrieve an Amadeus PNR by record locator
262
     *
263
     * By default, the result will be the PNR_Reply XML as string.
264
     * That way you can easily parse the PNR's contents with XPath.
265
     *
266
     * https://webservices.amadeus.com/extranet/viewService.do?id=27&flavourId=1&menuId=functional
267
     *
268
     * @param RequestOptions\PnrRetrieveOptions $options
269
     * @param array $messageOptions (OPTIONAL) Set ['asString'] = 'false' to get PNR_Reply as a PHP object.
270
     * @return Result
271
     * @throws Exception
272
     */
273 View Code Duplication
    public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
274
    {
275
        $msgName = 'PNR_Retrieve';
276
        $messageOptions = $this->makeMessageOptions($messageOptions);
277
278
        $sendResult = $this->sessionHandler->sendMessage(
279
            $msgName,
280
            $this->requestCreator->createRequest(
281
                $msgName,
282
                $options
283
            ),
284
            $messageOptions
285
        );
286
287
        return $this->responseHandler->analyzeResponse(
288
            $sendResult,
289
            $msgName
290
        );
291
    }
292
293
    /**
294
     * Create a PNR using PNR_AddMultiElements
295
     *
296
     * @param RequestOptions\PnrCreatePnrOptions $options
297
     * @param array $messageOptions
298
     * @return Result
299
     */
300 View Code Duplication
    public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
301
    {
302
        $msgName = 'PNR_AddMultiElements';
303
        $messageOptions = $this->makeMessageOptions($messageOptions);
304
305
        $sendResult = $this->sessionHandler->sendMessage(
306
            $msgName,
307
            $this->requestCreator->createRequest(
308
                $msgName,
309
                $options
310
            ),
311
            $messageOptions
312
        );
313
314
        return $this->responseHandler->analyzeResponse(
315
            $sendResult,
316
            $msgName
317
        );
318
    }
319
320
    /**
321
     * PNR_AddMultiElements - Create a new PNR or update an existing PNR.
322
     *
323
     * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional
324
     *
325
     * @todo implement message creation - maybe split up in separate Create & Modify PNR?
326
     * @param RequestOptions\PnrAddMultiElementsOptions $options
327
     * @param array $messageOptions
328
     * @return Result
329
     */
330 View Code Duplication
    public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
331
    {
332
        $msgName = 'PNR_AddMultiElements';
333
        $messageOptions = $this->makeMessageOptions($messageOptions);
334
335
        $sendResult = $this->sessionHandler->sendMessage(
336
            $msgName,
337
            $this->requestCreator->createRequest(
338
                $msgName,
339
                $options
340
            ),
341
            $messageOptions
342
        );
343
344
        return $this->responseHandler->analyzeResponse(
345
            $sendResult,
346
            $msgName
347
        );
348
    }
349
350
    /**
351
     * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info
352
     *
353
     * This extra info is info you cannot see in the regular PNR, like Offers.
354
     *
355
     * By default, the result will be the PNR_RetrieveAndDisplayReply XML as string.
356
     * That way you can easily parse the PNR's contents with XPath.
357
     *
358
     * Set $messageOptions['asString'] = FALSE to get the response as a PHP object.
359
     *
360
     * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional
361
     *
362
     * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR
363
     * @param array $messageOptions (OPTIONAL) Set ['asString'] = 'false' to get PNR_RetrieveAndDisplayReply as a PHP object.
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
364
     * @return Result
365
     * @throws Exception
366
     **/
367 View Code Duplication
    public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
368
    {
369
        $msgName = 'PNR_RetrieveAndDisplay';
370
        $messageOptions = $this->makeMessageOptions($messageOptions);
371
372
        $sendResult = $this->sessionHandler->sendMessage(
373
            $msgName,
374
            $this->requestCreator->createRequest(
375
                $msgName,
376
                $options
377
            ),
378
            $messageOptions
379
        );
380
381
        return $this->responseHandler->analyzeResponse(
382
            $sendResult,
383
            $msgName
384
        );
385
    }
386
387
    /**
388
     * PNR_Cancel
389
     *
390
     * @param RequestOptions\PnrCancelOptions $options
391
     * @param array $messageOptions
392
     * @return Result
393
     */
394 View Code Duplication
    public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
395
    {
396
        $msgName = 'PNR_Cancel';
397
        $messageOptions = $this->makeMessageOptions($messageOptions);
398
399
        $sendResult = $this->sessionHandler->sendMessage(
400
            $msgName,
401
            $this->requestCreator->createRequest(
402
                $msgName,
403
                $options
404
            ),
405
            $messageOptions
406
        );
407
408
        return $this->responseHandler->analyzeResponse(
409
            $sendResult,
410
            $msgName
411
        );
412
    }
413
414
    /**
415
     * PNR_DisplayHistory
416
     *
417
     * @param RequestOptions\PnrDisplayHistoryOptions $options
418
     * @param array $messageOptions
419
     * @return Result
420
     */
421 View Code Duplication
    public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
422
    {
423
        $msgName = 'PNR_DisplayHistory';
424
        $messageOptions = $this->makeMessageOptions($messageOptions);
425
426
        $sendResult = $this->sessionHandler->sendMessage(
427
            $msgName,
428
            $this->requestCreator->createRequest(
429
                $msgName,
430
                $options
431
            ),
432
            $messageOptions
433
        );
434
435
        return $this->responseHandler->analyzeResponse(
436
            $sendResult,
437
            $msgName
438
        );
439
    }
440
441
    /**
442
     * Queue_List - get a list of all PNR's on a given queue
443
     *
444
     * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional
445
     *
446
     * @param RequestOptions\QueueListOptions $options
447
     * @param array $messageOptions
448
     * @return Result
449
     */
450 View Code Duplication
    public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
451
    {
452
        $msgName = 'Queue_List';
453
        $messageOptions = $this->makeMessageOptions($messageOptions);
454
455
        $sendResult = $this->sessionHandler->sendMessage(
456
            $msgName,
457
            $this->requestCreator->createRequest(
458
                $msgName,
459
                $options
460
            ),
461
            $messageOptions
462
        );
463
464
        return $this->responseHandler->analyzeResponse(
465
            $sendResult,
466
            $msgName
467
        );
468
    }
469
470
    /**
471
     * Queue_PlacePNR - Place a PNR on a given queue
472
     *
473
     * @param RequestOptions\QueuePlacePnrOptions $options
474
     * @param array $messageOptions
475
     * @return Result
476
     */
477 View Code Duplication
    public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
478
    {
479
        $msgName = 'Queue_PlacePNR';
480
        $messageOptions = $this->makeMessageOptions($messageOptions);
481
482
        $sendResult = $this->sessionHandler->sendMessage(
483
            $msgName,
484
            $this->requestCreator->createRequest(
485
                $msgName,
486
                $options
487
            ),
488
            $messageOptions
489
        );
490
491
        return $this->responseHandler->analyzeResponse(
492
            $sendResult,
493
            $msgName
494
        );
495
    }
496
497
    /**
498
     * Queue_RemoveItem - remove an item (a PNR) from a given queue
499
     *
500
     * @param RequestOptions\QueueRemoveItemOptions $options
501
     * @param array $messageOptions
502
     * @return Result
503
     */
504 View Code Duplication
    public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
505
    {
506
        $msgName = 'Queue_RemoveItem';
507
        $messageOptions = $this->makeMessageOptions($messageOptions);
508
509
        $sendResult = $this->sessionHandler->sendMessage(
510
            $msgName,
511
            $this->requestCreator->createRequest(
512
                $msgName,
513
                $options
514
            ),
515
            $messageOptions
516
        );
517
518
        return $this->responseHandler->analyzeResponse(
519
            $sendResult,
520
            $msgName
521
        );
522
    }
523
524
    /**
525
     * Queue_MoveItem - move an item (a PNR) from one queue to another.
526
     *
527
     * @param RequestOptions\QueueMoveItemOptions $options
528
     * @param array $messageOptions
529
     * @return Result
530
     */
531 View Code Duplication
    public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
532
    {
533
        $msgName = 'Queue_MoveItem';
534
        $messageOptions = $this->makeMessageOptions($messageOptions);
535
536
        $sendResult = $this->sessionHandler->sendMessage(
537
            $msgName,
538
            $this->requestCreator->createRequest(
539
                $msgName,
540
                $options
541
            ),
542
            $messageOptions
543
        );
544
545
        return $this->responseHandler->analyzeResponse(
546
            $sendResult,
547
            $msgName
548
        );
549
    }
550
551
    /**
552
     * Offer_VerifyOffer
553
     *
554
     * To be called in the context of an open PNR
555
     *
556
     * @param RequestOptions\OfferVerifyOptions $options
557
     * @param array $messageOptions
558
     * @return Result
559
     */
560 View Code Duplication
    public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
561
    {
562
        $msgName = 'Offer_VerifyOffer';
563
        $messageOptions = $this->makeMessageOptions($messageOptions);
564
565
        $sendResult = $this->sessionHandler->sendMessage(
566
            $msgName,
567
            $this->requestCreator->createRequest(
568
                $msgName,
569
                $options
570
            ),
571
            $messageOptions
572
        );
573
574
        return $this->responseHandler->analyzeResponse(
575
            $sendResult,
576
            $msgName
577
        );
578
    }
579
580
    /**
581
     * Offer_ConfirmAirOffer
582
     *
583
     * @param RequestOptions\OfferConfirmAirOptions $options
584
     * @param array $messageOptions
585
     * @return Result
586
     */
587 View Code Duplication
    public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
588
    {
589
        $msgName = 'Offer_ConfirmAirOffer';
590
        $messageOptions = $this->makeMessageOptions($messageOptions);
591
592
        $sendResult = $this->sessionHandler->sendMessage(
593
            $msgName,
594
            $this->requestCreator->createRequest(
595
                $msgName,
596
                $options
597
            ),
598
            $messageOptions
599
        );
600
601
        return $this->responseHandler->analyzeResponse(
602
            $sendResult,
603
            $msgName
604
        );
605
    }
606
607
    /**
608
     * Offer_ConfirmHotelOffer
609
     *
610
     * @param RequestOptions\OfferConfirmHotelOptions $options
611
     * @param array $messageOptions
612
     * @return Result
613
     */
614 View Code Duplication
    public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
615
    {
616
        $msgName = 'Offer_ConfirmHotelOffer';
617
        $messageOptions = $this->makeMessageOptions($messageOptions);
618
619
        $sendResult = $this->sessionHandler->sendMessage(
620
            $msgName,
621
            $this->requestCreator->createRequest(
622
                $msgName,
623
                $options
624
            ),
625
            $messageOptions
626
        );
627
628
        return $this->responseHandler->analyzeResponse(
629
            $sendResult,
630
            $msgName
631
        );
632
    }
633
634
    /**
635
     * Offer_ConfirmCarOffer
636
     *
637
     * @param RequestOptions\OfferConfirmCarOptions $options
638
     * @param array $messageOptions
639
     * @return Result
640
     */
641 View Code Duplication
    public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
642
    {
643
        $msgName = 'Offer_ConfirmCarOffer';
644
        $messageOptions = $this->makeMessageOptions($messageOptions);
645
646
        $sendResult = $this->sessionHandler->sendMessage(
647
            $msgName,
648
            $this->requestCreator->createRequest(
649
                $msgName,
650
                $options
651
            ),
652
            $messageOptions
653
        );
654
655
        return $this->responseHandler->analyzeResponse(
656
            $sendResult,
657
            $msgName
658
        );
659
    }
660
661
    /**
662
     * Fare_MasterPricerTravelBoardSearch
663
     *
664
     * @param RequestOptions\FareMasterPricerTbSearch $options
665
     * @param array $messageOptions
666
     * @return Result
667
     */
668 View Code Duplication
    public function fareMasterPricerTravelBoardSearch(RequestOptions\FareMasterPricerTbSearch $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
669
    {
670
        $msgName = 'Fare_MasterPricerTravelBoardSearch';
671
        $messageOptions = $this->makeMessageOptions($messageOptions);
672
673
        $sendResult = $this->sessionHandler->sendMessage(
674
            $msgName,
675
            $this->requestCreator->createRequest(
676
                $msgName,
677
                $options
678
            ),
679
            $messageOptions
680
        );
681
682
        return $this->responseHandler->analyzeResponse(
683
            $sendResult,
684
            $msgName
685
        );
686
    }
687
688
    /**
689
     * Fare_PricePnrWithBookingClass
690
     *
691
     * @param RequestOptions\FarePricePnrWithBookingClassOptions $options
692
     * @param array $messageOptions
693
     * @return Result
694
     */
695 View Code Duplication
    public function farePricePnrWithBookingClass(RequestOptions\FarePricePnrWithBookingClassOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 131 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
696
    {
697
        $msgName = 'Fare_PricePNRWithBookingClass';
698
        $messageOptions = $this->makeMessageOptions($messageOptions);
699
700
        $sendResult = $this->sessionHandler->sendMessage(
701
            $msgName,
702
            $this->requestCreator->createRequest(
703
                $msgName,
704
                $options
705
            ),
706
            $messageOptions
707
        );
708
709
        return $this->responseHandler->analyzeResponse(
710
            $sendResult,
711
            $msgName
712
        );
713
    }
714
715
    /**
716
     * Fare_InformativePricingWithoutPNR
717
     *
718
     * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options
719
     * @param array $messageOptions
720
     * @return Result
721
     */
722 View Code Duplication
    public function fareInformativePricingWithoutPnr(RequestOptions\FareInformativePricingWithoutPnrOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 139 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
723
    {
724
        $msgName = 'Fare_InformativePricingWithoutPNR';
725
        $messageOptions = $this->makeMessageOptions($messageOptions);
726
727
        $sendResult = $this->sessionHandler->sendMessage(
728
            $msgName,
729
            $this->requestCreator->createRequest(
730
                $msgName,
731
                $options
732
            ),
733
            $messageOptions
734
        );
735
736
        return $this->responseHandler->analyzeResponse(
737
            $sendResult,
738
            $msgName
739
        );
740
    }
741
742
    /**
743
     * Fare_CheckRules
744
     *
745
     * @param RequestOptions\FareCheckRulesOptions $options
746
     * @param array $messageOptions
747
     * @return Result
748
     */
749 View Code Duplication
    public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
750
    {
751
        $msgName = 'Fare_CheckRules';
752
        $messageOptions = $this->makeMessageOptions($messageOptions);
753
754
        $sendResult = $this->sessionHandler->sendMessage(
755
            $msgName,
756
            $this->requestCreator->createRequest(
757
                $msgName,
758
                $options
759
            ),
760
            $messageOptions
761
        );
762
763
        return $this->responseHandler->analyzeResponse(
764
            $sendResult,
765
            $msgName
766
        );
767
    }
768
769
    /**
770
     * Fare_ConvertCurrency
771
     *
772
     * @param RequestOptions\FareConvertCurrencyOptions $options
773
     * @param array $messageOptions
774
     * @return Result
775
     */
776 View Code Duplication
    public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
777
    {
778
        $msgName = 'Fare_ConvertCurrency';
779
        $messageOptions = $this->makeMessageOptions($messageOptions);
780
781
        $sendResult = $this->sessionHandler->sendMessage(
782
            $msgName,
783
            $this->requestCreator->createRequest(
784
                $msgName,
785
                $options
786
            ),
787
            $messageOptions
788
        );
789
790
        return $this->responseHandler->analyzeResponse(
791
            $sendResult,
792
            $msgName
793
        );
794
    }
795
796
    /**
797
     * Air_SellFromRecommendation
798
     *
799
     * @param RequestOptions\AirSellFromRecommendationOptions $options
800
     * @param array $messageOptions
801
     * @return Result
802
     */
803 View Code Duplication
    public function airSellFromRecommendation(RequestOptions\AirSellFromRecommendationOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
804
    {
805
        $msgName = 'Air_SellFromRecommendation';
806
        $messageOptions = $this->makeMessageOptions($messageOptions);
807
808
        $sendResult = $this->sessionHandler->sendMessage(
809
            $msgName,
810
            $this->requestCreator->createRequest(
811
                $msgName,
812
                $options
813
            ),
814
            $messageOptions
815
        );
816
817
        return $this->responseHandler->analyzeResponse(
818
            $sendResult,
819
            $msgName
820
        );
821
    }
822
823
    /**
824
     * Air_FlightInfo
825
     *
826
     * @param RequestOptions\AirFlightInfoOptions $options
827
     * @param array $messageOptions
828
     * @return Result
829
     */
830 View Code Duplication
    public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
831
    {
832
        $msgName = 'Air_FlightInfo';
833
        $messageOptions = $this->makeMessageOptions($messageOptions);
834
835
        $sendResult = $this->sessionHandler->sendMessage(
836
            $msgName,
837
            $this->requestCreator->createRequest(
838
                $msgName,
839
                $options
840
            ),
841
            $messageOptions
842
        );
843
844
        return $this->responseHandler->analyzeResponse(
845
            $sendResult,
846
            $msgName
847
        );
848
    }
849
850
    /**
851
     * Air_RetrieveSeatMap
852
     *
853
     * @param RequestOptions\AirRetrieveSeatMapOptions $options
854
     * @param array $messageOptions
855
     * @return Result
856
     */
857 View Code Duplication
    public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
858
    {
859
        $msgName = 'Air_RetrieveSeatMap';
860
        $messageOptions = $this->makeMessageOptions($messageOptions);
861
862
        $sendResult = $this->sessionHandler->sendMessage(
863
            $msgName,
864
            $this->requestCreator->createRequest(
865
                $msgName,
866
                $options
867
            ),
868
            $messageOptions
869
        );
870
871
        return $this->responseHandler->analyzeResponse(
872
            $sendResult,
873
            $msgName
874
        );
875
    }
876
877
    /**
878
     * Command_Cryptic
879
     *
880
     * @param RequestOptions\CommandCrypticOptions $options
881
     * @param array $messageOptions
882
     * @return Result
883
     */
884 View Code Duplication
    public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
885
    {
886
        $msgName = 'Command_Cryptic';
887
        $messageOptions = $this->makeMessageOptions($messageOptions);
888
889
        $sendResult = $this->sessionHandler->sendMessage(
890
            $msgName,
891
            $this->requestCreator->createRequest(
892
                $msgName,
893
                $options
894
            ),
895
            $messageOptions
896
        );
897
898
        return $this->responseHandler->analyzeResponse(
899
            $sendResult,
900
            $msgName
901
        );
902
    }
903
904
    /**
905
     * MiniRule_GetFromPricingRec
906
     *
907
     * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options
908
     * @param array $messageOptions
909
     * @return Result
910
     */
911 View Code Duplication
    public function miniRuleGetFromPricingRec(RequestOptions\MiniRuleGetFromPricingRecOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
912
    {
913
        $msgName = 'MiniRule_GetFromPricingRec';
914
        $messageOptions = $this->makeMessageOptions($messageOptions);
915
916
        $sendResult = $this->sessionHandler->sendMessage(
917
            $msgName,
918
            $this->requestCreator->createRequest(
919
                $msgName,
920
                $options
921
            ),
922
            $messageOptions
923
        );
924
925
        return $this->responseHandler->analyzeResponse(
926
            $sendResult,
927
            $msgName
928
        );
929
    }
930
931
    /**
932
     * Info_EncodeDecodeCity
933
     *
934
     * @param RequestOptions\InfoEncodeDecodeCityOptions $options
935
     * @param array $messageOptions
936
     * @return Result
937
     */
938 View Code Duplication
    public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
939
    {
940
        $msgName = 'Info_EncodeDecodeCity';
941
        $messageOptions = $this->makeMessageOptions($messageOptions);
942
943
        $sendResult = $this->sessionHandler->sendMessage(
944
            $msgName,
945
            $this->requestCreator->createRequest(
946
                $msgName,
947
                $options
948
            ),
949
            $messageOptions
950
        );
951
952
        return $this->responseHandler->analyzeResponse(
953
            $sendResult,
954
            $msgName
955
        );
956
    }
957
958
959
    /**
960
     * Ticket_CreateTSTFromPricing
961
     *
962
     * @param RequestOptions\TicketCreateTstFromPricingOptions $options
963
     * @param array $messageOptions
964
     * @return Result
965
     */
966 View Code Duplication
    public function ticketCreateTSTFromPricing(RequestOptions\TicketCreateTstFromPricingOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 127 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
967
    {
968
        $msgName = 'Ticket_CreateTSTFromPricing';
969
        $messageOptions = $this->makeMessageOptions($messageOptions);
970
971
        $sendResult = $this->sessionHandler->sendMessage(
972
            $msgName,
973
            $this->requestCreator->createRequest(
974
                $msgName,
975
                $options
976
            ),
977
            $messageOptions
978
        );
979
980
        return $this->responseHandler->analyzeResponse(
981
            $sendResult,
982
            $msgName
983
        );
984
    }
985
986
    /**
987
     * DocIssuance_IssueTicket
988
     *
989
     * @param RequestOptions\DocIssuanceIssueTicketOptions $options
990
     * @param array $messageOptions
991
     * @return Result
992
     */
993 View Code Duplication
    public function docIssuanceIssueTicket(RequestOptions\DocIssuanceIssueTicketOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
994
    {
995
        $msgName = 'DocIssuance_IssueTicket';
996
        $messageOptions = $this->makeMessageOptions($messageOptions);
997
998
        $sendResult = $this->sessionHandler->sendMessage(
999
            $msgName,
1000
            $this->requestCreator->createRequest(
1001
                $msgName,
1002
                $options
1003
            ),
1004
            $messageOptions
1005
        );
1006
1007
        return $this->responseHandler->analyzeResponse(
1008
            $sendResult,
1009
            $msgName
1010
        );
1011
    }
1012
1013
    /**
1014
     * PriceXplorer_ExtremeSearch
1015
     *
1016
     * @param RequestOptions\PriceXplorerExtremeSearchOptions $options
1017
     * @param array $messageOptions
1018
     * @return Result
1019
     */
1020 View Code Duplication
    public function priceXplorerExtremeSearch(RequestOptions\PriceXplorerExtremeSearchOptions $options, $messageOptions = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 125 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
1021
    {
1022
        $msgName = 'PriceXplorer_ExtremeSearch';
1023
        $messageOptions = $this->makeMessageOptions($messageOptions);
1024
1025
        $sendResult = $this->sessionHandler->sendMessage(
1026
            $msgName,
1027
            $this->requestCreator->createRequest(
1028
                $msgName,
1029
                $options
1030
            ),
1031
            $messageOptions
1032
        );
1033
1034
        return $this->responseHandler->analyzeResponse(
1035
            $sendResult,
1036
            $msgName
1037
        );
1038
    }
1039
1040
    /**
1041
     * Make message options
1042
     *
1043
     * Message options are meta options when sending a message to the amadeus web services
1044
     * - (if stateful) should we end the current session after sending this call?
1045
     * - do you want the response as a PHP object or as a string?
1046
     * - ... ?
1047
     *
1048
     * @param array $incoming The Message options chosen by the caller - if any.
1049
     * @param bool $endSession Switch if you want to terminate the current session after making the call.
1050
     * @return array
1051
     */
1052
    protected function makeMessageOptions(array $incoming, $endSession = false)
1053
    {
1054
        $options = [
1055
            'endSession' => $endSession
1056
        ];
1057
1058
        if (array_key_exists('endSession', $incoming)) {
1059
            $options['endSession'] = $incoming['endSession'];
1060
        }
1061
1062
        return $options;
1063
    }
1064
1065
    /**
1066
     * Load the session handler
1067
     *
1068
     * Either load the provided session handler or create one depending on incoming parameters.
1069
     *
1070
     * @param HandlerInterface|null $sessionHandler
1071
     * @param Params\SessionHandlerParams $params
1072
     * @return HandlerInterface
1073
     */
1074
    protected function loadSessionHandler($sessionHandler, $params)
1075
    {
1076
        $newSessionHandler = null;
0 ignored issues
show
Unused Code introduced by
$newSessionHandler is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1077
1078
        if ($sessionHandler instanceof HandlerInterface) {
1079
            $newSessionHandler = $sessionHandler;
1080
        } else {
1081
            $newSessionHandler = HandlerFactory::createHandler($params);
1082
        }
1083
1084
        return $newSessionHandler;
1085
    }
1086
1087
    /**
1088
     * Load a request creator
1089
     *
1090
     * A request creator is responsible for generating the correct request to send.
1091
     *
1092
     * @param RequestCreatorInterface|null $requestCreator
1093
     * @param Params\RequestCreatorParams $params
1094
     * @param string $libIdentifier Library identifier & version string (for Received From)
1095
     * @param string $originatorOffice The Office we are signed in with.
1096
     * @param array $mesVer Messages & Versions array of active messages in the WSDL
1097
     * @return RequestCreatorInterface
1098
     * @throws \RuntimeException
1099
     */
1100
    protected function loadRequestCreator($requestCreator, $params, $libIdentifier, $originatorOffice, $mesVer)
1101
    {
1102
        $newRequestCreator = null;
0 ignored issues
show
Unused Code introduced by
$newRequestCreator is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1103
1104
        if ($requestCreator instanceof RequestCreatorInterface) {
1105
            $newRequestCreator = $requestCreator;
1106
        } else {
1107
            $params->originatorOfficeId = $originatorOffice;
1108
            $params->messagesAndVersions = $mesVer;
1109
1110
            $newRequestCreator = RequestCreatorFactory::createRequestCreator(
1111
                $params,
1112
                $libIdentifier
1113
            );
1114
        }
1115
1116
        return $newRequestCreator;
1117
    }
1118
1119
    /**
1120
     * Load a response handler
1121
     *
1122
     * @param ResponseHandlerInterface|null $responseHandler
1123
     *
1124
     * @return ResponseHandlerInterface
1125
     * @throws \RuntimeException
1126
     */
1127
    protected function loadResponseHandler($responseHandler)
1128
    {
1129
        $newResponseHandler = null;
0 ignored issues
show
Unused Code introduced by
$newResponseHandler is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
1130
1131
        if ($responseHandler instanceof ResponseHandlerInterface) {
1132
            $newResponseHandler = $responseHandler;
1133
        } else {
1134
            $newResponseHandler = new ResponseHandlerBase();
1135
        }
1136
1137
        return $newResponseHandler;
1138
    }
1139
}
1140