Complex classes like Client often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Client, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 45 | class Client |
||
| 46 | { |
||
| 47 | /** |
||
| 48 | * Amadeus SOAP header version 1 |
||
| 49 | */ |
||
| 50 | const HEADER_V1 = "1"; |
||
| 51 | /** |
||
| 52 | * Amadeus SOAP header version 2 |
||
| 53 | */ |
||
| 54 | const HEADER_V2 = "2"; |
||
| 55 | /** |
||
| 56 | * Amadeus SOAP header version 4 |
||
| 57 | */ |
||
| 58 | const HEADER_V4 = "4"; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Version string |
||
| 62 | * |
||
| 63 | * @var string |
||
| 64 | */ |
||
| 65 | const VERSION = "1.1.0-dev"; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * An identifier string for the library (to be used in Received From entries) |
||
| 69 | * |
||
| 70 | * @var string |
||
| 71 | */ |
||
| 72 | const RECEIVED_FROM_IDENTIFIER = "amabnl-amadeus-ws-client"; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Session Handler will be sending all the messages and handling all session-related things. |
||
| 76 | * |
||
| 77 | * @var HandlerInterface |
||
| 78 | */ |
||
| 79 | protected $sessionHandler; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Request Creator is will create the correct message structure to send to the SOAP server. |
||
| 83 | * |
||
| 84 | * @var RequestCreatorInterface |
||
| 85 | */ |
||
| 86 | protected $requestCreator; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Response Handler will check the received response for errors. |
||
| 90 | * |
||
| 91 | * @var ResponseHandlerInterface |
||
| 92 | */ |
||
| 93 | protected $responseHandler; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * Authentication parameters |
||
| 97 | * |
||
| 98 | * @var Params\AuthParams |
||
| 99 | */ |
||
| 100 | protected $authParams; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @var string |
||
| 104 | */ |
||
| 105 | protected $lastMessage; |
||
| 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($this->lastMessage); |
||
| 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($this->lastMessage); |
||
| 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) && |
||
| 182 | $params->sessionHandlerParams instanceof Params\SessionHandlerParams |
||
| 183 | ) { |
||
| 184 | $params->sessionHandlerParams->authParams = $this->authParams; |
||
| 185 | } |
||
| 186 | } |
||
| 187 | |||
| 188 | $this->sessionHandler = $this->loadSessionHandler( |
||
| 189 | $params->sessionHandler, |
||
| 190 | $params->sessionHandlerParams |
||
|
|
|||
| 191 | ); |
||
| 192 | |||
| 193 | $this->requestCreator = $this->loadRequestCreator( |
||
| 194 | $params->requestCreator, |
||
| 195 | $params->requestCreatorParams, |
||
| 196 | self::RECEIVED_FROM_IDENTIFIER . "-" .self::VERSION, |
||
| 197 | $this->sessionHandler->getOriginatorOffice(), |
||
| 198 | $this->sessionHandler->getMessagesAndVersions() |
||
| 199 | ); |
||
| 200 | |||
| 201 | $this->responseHandler = $this->loadResponseHandler( |
||
| 202 | $params->responseHandler |
||
| 203 | ); |
||
| 204 | } |
||
| 205 | |||
| 206 | /** |
||
| 207 | * Authenticate. |
||
| 208 | * |
||
| 209 | * Parameters were provided at construction time (sessionhandlerparams) |
||
| 210 | * |
||
| 211 | * @return Result |
||
| 212 | * @throws Exception |
||
| 213 | */ |
||
| 214 | public function securityAuthenticate() |
||
| 215 | { |
||
| 216 | $msgName = 'Security_Authenticate'; |
||
| 217 | |||
| 218 | return $this->callMessage( |
||
| 219 | $msgName, |
||
| 220 | new RequestOptions\SecurityAuthenticateOptions( |
||
| 221 | $this->authParams |
||
| 222 | ), |
||
| 223 | [], |
||
| 224 | false |
||
| 225 | ); |
||
| 226 | } |
||
| 227 | |||
| 228 | /** |
||
| 229 | * Terminate a session - only applicable to non-stateless mode. |
||
| 230 | * |
||
| 231 | * @return Result |
||
| 232 | * @throws Exception |
||
| 233 | */ |
||
| 234 | public function securitySignOut() |
||
| 235 | { |
||
| 236 | $msgName = 'Security_SignOut'; |
||
| 237 | |||
| 238 | return $this->callMessage( |
||
| 239 | $msgName, |
||
| 240 | new RequestOptions\SecuritySignOutOptions(), |
||
| 241 | [], |
||
| 242 | true |
||
| 243 | ); |
||
| 244 | } |
||
| 245 | |||
| 246 | /** |
||
| 247 | * PNR_Retrieve - Retrieve an Amadeus PNR by record locator |
||
| 248 | * |
||
| 249 | * By default, the result will be the PNR_Reply XML as string. |
||
| 250 | * That way you can easily parse the PNR's contents with XPath. |
||
| 251 | * |
||
| 252 | * https://webservices.amadeus.com/extranet/viewService.do?id=27&flavourId=1&menuId=functional |
||
| 253 | * |
||
| 254 | * @param RequestOptions\PnrRetrieveOptions $options |
||
| 255 | * @param array $messageOptions (OPTIONAL) |
||
| 256 | * @return Result |
||
| 257 | * @throws Exception |
||
| 258 | */ |
||
| 259 | public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = []) |
||
| 260 | { |
||
| 261 | $msgName = 'PNR_Retrieve'; |
||
| 262 | |||
| 263 | return $this->callMessage($msgName, $options, $messageOptions); |
||
| 264 | } |
||
| 265 | |||
| 266 | /** |
||
| 267 | * Create a PNR using PNR_AddMultiElements |
||
| 268 | * |
||
| 269 | * @param RequestOptions\PnrCreatePnrOptions $options |
||
| 270 | * @param array $messageOptions (OPTIONAL) |
||
| 271 | * @return Result |
||
| 272 | */ |
||
| 273 | public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = []) |
||
| 274 | { |
||
| 275 | $msgName = 'PNR_AddMultiElements'; |
||
| 276 | |||
| 277 | return $this->callMessage($msgName, $options, $messageOptions); |
||
| 278 | } |
||
| 279 | |||
| 280 | /** |
||
| 281 | * PNR_AddMultiElements - Create a new PNR or update an existing PNR. |
||
| 282 | * |
||
| 283 | * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional |
||
| 284 | * |
||
| 285 | * @param RequestOptions\PnrAddMultiElementsOptions $options |
||
| 286 | * @param array $messageOptions (OPTIONAL) |
||
| 287 | * @return Result |
||
| 288 | */ |
||
| 289 | public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = []) |
||
| 295 | |||
| 296 | /** |
||
| 297 | * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info |
||
| 298 | * |
||
| 299 | * This extra info is info you cannot see in the regular PNR, like Offers. |
||
| 300 | * |
||
| 301 | * By default, the result will be the PNR_RetrieveAndDisplayReply XML as string. |
||
| 302 | * That way you can easily parse the PNR's contents with XPath. |
||
| 303 | * |
||
| 304 | * Set $messageOptions['asString'] = FALSE to get the response as a PHP object. |
||
| 305 | * |
||
| 306 | * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional |
||
| 307 | * |
||
| 308 | * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR |
||
| 309 | * @param array $messageOptions (OPTIONAL) |
||
| 310 | * @return Result |
||
| 311 | * @throws Exception |
||
| 312 | **/ |
||
| 313 | public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = []) |
||
| 319 | |||
| 320 | /** |
||
| 321 | * PNR_Cancel |
||
| 322 | * |
||
| 323 | * @param RequestOptions\PnrCancelOptions $options |
||
| 324 | * @param array $messageOptions (OPTIONAL) |
||
| 325 | * @return Result |
||
| 326 | */ |
||
| 327 | public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = []) |
||
| 333 | |||
| 334 | /** |
||
| 335 | * PNR_DisplayHistory |
||
| 336 | * |
||
| 337 | * @param RequestOptions\PnrDisplayHistoryOptions $options |
||
| 338 | * @param array $messageOptions (OPTIONAL) |
||
| 339 | * @return Result |
||
| 340 | */ |
||
| 341 | public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = []) |
||
| 347 | |||
| 348 | /** |
||
| 349 | * PNR_TransferOwnership |
||
| 350 | * |
||
| 351 | * @param RequestOptions\PnrTransferOwnershipOptions $options |
||
| 352 | * @param array $messageOptions (OPTIONAL) |
||
| 353 | * @return Result |
||
| 354 | */ |
||
| 355 | public function pnrTransferOwnership(RequestOptions\PnrTransferOwnershipOptions $options, $messageOptions = []) |
||
| 356 | { |
||
| 357 | $msgName = 'PNR_TransferOwnership'; |
||
| 358 | |||
| 361 | |||
| 362 | /** |
||
| 363 | * Queue_List - get a list of all PNR's on a given queue |
||
| 364 | * |
||
| 365 | * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional |
||
| 366 | * |
||
| 367 | * @param RequestOptions\QueueListOptions $options |
||
| 368 | * @param array $messageOptions (OPTIONAL) |
||
| 369 | * @return Result |
||
| 370 | */ |
||
| 371 | public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = []) |
||
| 377 | |||
| 378 | /** |
||
| 379 | * Queue_PlacePNR - Place a PNR on a given queue |
||
| 380 | * |
||
| 381 | * @param RequestOptions\QueuePlacePnrOptions $options |
||
| 382 | * @param array $messageOptions (OPTIONAL) |
||
| 383 | * @return Result |
||
| 384 | */ |
||
| 385 | public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = []) |
||
| 391 | |||
| 392 | /** |
||
| 393 | * Queue_RemoveItem - remove an item (a PNR) from a given queue |
||
| 394 | * |
||
| 395 | * @param RequestOptions\QueueRemoveItemOptions $options |
||
| 396 | * @param array $messageOptions (OPTIONAL) |
||
| 397 | * @return Result |
||
| 398 | */ |
||
| 399 | public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = []) |
||
| 405 | |||
| 406 | /** |
||
| 407 | * Queue_MoveItem - move an item (a PNR) from one queue to another. |
||
| 408 | * |
||
| 409 | * @param RequestOptions\QueueMoveItemOptions $options |
||
| 410 | * @param array $messageOptions (OPTIONAL) |
||
| 411 | * @return Result |
||
| 412 | */ |
||
| 413 | public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = []) |
||
| 419 | |||
| 420 | /** |
||
| 421 | * Offer_VerifyOffer |
||
| 422 | * |
||
| 423 | * To be called in the context of an open PNR |
||
| 424 | * |
||
| 425 | * @param RequestOptions\OfferVerifyOptions $options |
||
| 426 | * @param array $messageOptions (OPTIONAL) |
||
| 427 | * @return Result |
||
| 428 | */ |
||
| 429 | public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = []) |
||
| 435 | |||
| 436 | /** |
||
| 437 | * Offer_ConfirmAirOffer |
||
| 438 | * |
||
| 439 | * @param RequestOptions\OfferConfirmAirOptions $options |
||
| 440 | * @param array $messageOptions (OPTIONAL) |
||
| 441 | * @return Result |
||
| 442 | */ |
||
| 443 | public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = []) |
||
| 449 | |||
| 450 | /** |
||
| 451 | * Offer_ConfirmHotelOffer |
||
| 452 | * |
||
| 453 | * @param RequestOptions\OfferConfirmHotelOptions $options |
||
| 454 | * @param array $messageOptions (OPTIONAL) |
||
| 455 | * @return Result |
||
| 456 | */ |
||
| 457 | public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = []) |
||
| 463 | |||
| 464 | /** |
||
| 465 | * Offer_ConfirmCarOffer |
||
| 466 | * |
||
| 467 | * @param RequestOptions\OfferConfirmCarOptions $options |
||
| 468 | * @param array $messageOptions (OPTIONAL) |
||
| 469 | * @return Result |
||
| 470 | */ |
||
| 471 | public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = []) |
||
| 477 | |||
| 478 | /** |
||
| 479 | * Fare_MasterPricerTravelBoardSearch |
||
| 480 | * |
||
| 481 | * @param RequestOptions\FareMasterPricerTbSearch $options |
||
| 482 | * @param array $messageOptions (OPTIONAL) |
||
| 483 | * @return Result |
||
| 484 | */ |
||
| 485 | public function fareMasterPricerTravelBoardSearch( |
||
| 493 | |||
| 494 | /** |
||
| 495 | * Fare_MasterPricerCalendar |
||
| 496 | * |
||
| 497 | * @param RequestOptions\FareMasterPricerCalendarOptions $options |
||
| 498 | * @param array $messageOptions (OPTIONAL) |
||
| 499 | * @return Result |
||
| 500 | */ |
||
| 501 | public function fareMasterPricerCalendar( |
||
| 509 | |||
| 510 | /** |
||
| 511 | * Fare_PricePnrWithBookingClass |
||
| 512 | * |
||
| 513 | * @param RequestOptions\FarePricePnrWithBookingClassOptions $options |
||
| 514 | * @param array $messageOptions (OPTIONAL) |
||
| 515 | * @return Result |
||
| 516 | */ |
||
| 517 | public function farePricePnrWithBookingClass( |
||
| 525 | |||
| 526 | /** |
||
| 527 | * Fare_PricePnrWithLowerFares |
||
| 528 | * |
||
| 529 | * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options |
||
| 530 | * @param array $messageOptions (OPTIONAL) |
||
| 531 | * @return Result |
||
| 532 | */ |
||
| 533 | public function farePricePnrWithLowerFares( |
||
| 541 | |||
| 542 | /** |
||
| 543 | * Fare_PricePnrWithLowestFare |
||
| 544 | * |
||
| 545 | * @param RequestOptions\FarePricePnrWithLowestFareOptions $options |
||
| 546 | * @param array $messageOptions (OPTIONAL) |
||
| 547 | * @return Result |
||
| 548 | */ |
||
| 549 | public function farePricePnrWithLowestFare( |
||
| 557 | |||
| 558 | /** |
||
| 559 | * Fare_InformativePricingWithoutPNR |
||
| 560 | * |
||
| 561 | * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options |
||
| 562 | * @param array $messageOptions (OPTIONAL) |
||
| 563 | * @return Result |
||
| 564 | */ |
||
| 565 | public function fareInformativePricingWithoutPnr( |
||
| 573 | |||
| 574 | /** |
||
| 575 | * Fare_InformativeBestPricingWithoutPNR |
||
| 576 | * |
||
| 577 | * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options |
||
| 578 | * @param array $messageOptions (OPTIONAL) |
||
| 579 | * @return Result |
||
| 580 | */ |
||
| 581 | public function fareInformativeBestPricingWithoutPnr( |
||
| 589 | |||
| 590 | /** |
||
| 591 | * Fare_CheckRules |
||
| 592 | * |
||
| 593 | * @param RequestOptions\FareCheckRulesOptions $options |
||
| 594 | * @param array $messageOptions (OPTIONAL) |
||
| 595 | * @return Result |
||
| 596 | */ |
||
| 597 | public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = []) |
||
| 603 | |||
| 604 | /** |
||
| 605 | * Fare_ConvertCurrency |
||
| 606 | * |
||
| 607 | * @param RequestOptions\FareConvertCurrencyOptions $options |
||
| 608 | * @param array $messageOptions (OPTIONAL) |
||
| 609 | * @return Result |
||
| 610 | */ |
||
| 611 | public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = []) |
||
| 617 | |||
| 618 | /** |
||
| 619 | * Air_MultiAvailability |
||
| 620 | * |
||
| 621 | * @param RequestOptions\AirMultiAvailabilityOptions $options |
||
| 622 | * @param array $messageOptions (OPTIONAL) |
||
| 623 | * @return Result |
||
| 624 | */ |
||
| 625 | public function airMultiAvailability( |
||
| 633 | |||
| 634 | /** |
||
| 635 | * Air_SellFromRecommendation |
||
| 636 | * |
||
| 637 | * @param RequestOptions\AirSellFromRecommendationOptions $options |
||
| 638 | * @param array $messageOptions (OPTIONAL) |
||
| 639 | * @return Result |
||
| 640 | */ |
||
| 641 | public function airSellFromRecommendation( |
||
| 649 | |||
| 650 | /** |
||
| 651 | * Air_FlightInfo |
||
| 652 | * |
||
| 653 | * @param RequestOptions\AirFlightInfoOptions $options |
||
| 654 | * @param array $messageOptions (OPTIONAL) |
||
| 655 | * @return Result |
||
| 656 | */ |
||
| 657 | public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = []) |
||
| 663 | |||
| 664 | /** |
||
| 665 | * Air_RetrieveSeatMap |
||
| 666 | * |
||
| 667 | * @param RequestOptions\AirRetrieveSeatMapOptions $options |
||
| 668 | * @param array $messageOptions (OPTIONAL) |
||
| 669 | * @return Result |
||
| 670 | */ |
||
| 671 | public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = []) |
||
| 677 | |||
| 678 | /** |
||
| 679 | * Command_Cryptic |
||
| 680 | * |
||
| 681 | * @param RequestOptions\CommandCrypticOptions $options |
||
| 682 | * @param array $messageOptions (OPTIONAL) |
||
| 683 | * @return Result |
||
| 684 | */ |
||
| 685 | public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = []) |
||
| 691 | |||
| 692 | /** |
||
| 693 | * MiniRule_GetFromPricingRec |
||
| 694 | * |
||
| 695 | * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options |
||
| 696 | * @param array $messageOptions (OPTIONAL) |
||
| 697 | * @return Result |
||
| 698 | */ |
||
| 699 | public function miniRuleGetFromPricingRec( |
||
| 707 | |||
| 708 | /** |
||
| 709 | * MiniRule_GetFromPricing |
||
| 710 | * |
||
| 711 | * @param RequestOptions\MiniRuleGetFromPricingOptions $options |
||
| 712 | * @param array $messageOptions (OPTIONAL) |
||
| 713 | * @return Result |
||
| 714 | */ |
||
| 715 | public function miniRuleGetFromPricing( |
||
| 723 | |||
| 724 | /** |
||
| 725 | * Info_EncodeDecodeCity |
||
| 726 | * |
||
| 727 | * @param RequestOptions\InfoEncodeDecodeCityOptions $options |
||
| 728 | * @param array $messageOptions (OPTIONAL) |
||
| 729 | * @return Result |
||
| 730 | */ |
||
| 731 | public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = []) |
||
| 737 | |||
| 738 | |||
| 739 | /** |
||
| 740 | * Ticket_CreateTSTFromPricing |
||
| 741 | * |
||
| 742 | * @param RequestOptions\TicketCreateTstFromPricingOptions $options |
||
| 743 | * @param array $messageOptions (OPTIONAL) |
||
| 744 | * @return Result |
||
| 745 | */ |
||
| 746 | public function ticketCreateTSTFromPricing( |
||
| 754 | |||
| 755 | /** |
||
| 756 | * Ticket_DeleteTST |
||
| 757 | * |
||
| 758 | * @param RequestOptions\TicketDeleteTstOptions $options |
||
| 759 | * @param array $messageOptions (OPTIONAL) |
||
| 760 | * @return Result |
||
| 761 | */ |
||
| 762 | public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = []) |
||
| 768 | |||
| 769 | /** |
||
| 770 | * Ticket_DisplayTST |
||
| 771 | * |
||
| 772 | * @param RequestOptions\TicketDisplayTstOptions $options |
||
| 773 | * @param array $messageOptions (OPTIONAL) |
||
| 774 | * @return Result |
||
| 775 | */ |
||
| 776 | public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = []) |
||
| 782 | |||
| 783 | /** |
||
| 784 | * DocIssuance_IssueTicket |
||
| 785 | * |
||
| 786 | * @param RequestOptions\DocIssuanceIssueTicketOptions $options |
||
| 787 | * @param array $messageOptions (OPTIONAL) |
||
| 788 | * @return Result |
||
| 789 | */ |
||
| 790 | public function docIssuanceIssueTicket( |
||
| 798 | |||
| 799 | /** |
||
| 800 | * PriceXplorer_ExtremeSearch |
||
| 801 | * |
||
| 802 | * @param RequestOptions\PriceXplorerExtremeSearchOptions $options |
||
| 803 | * @param array $messageOptions (OPTIONAL) |
||
| 804 | * @return Result |
||
| 805 | */ |
||
| 806 | public function priceXplorerExtremeSearch( |
||
| 814 | |||
| 815 | /** |
||
| 816 | * SalesReports_DisplayQueryReport |
||
| 817 | * |
||
| 818 | * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options |
||
| 819 | * @param array $messageOptions (OPTIONAL) |
||
| 820 | * @return Result |
||
| 821 | */ |
||
| 822 | public function salesReportsDisplayQueryReport( |
||
| 830 | |||
| 831 | /** |
||
| 832 | * Call a message with the given parameters |
||
| 833 | * |
||
| 834 | * @param string $messageName |
||
| 835 | * @param RequestOptions\RequestOptionsInterface $options |
||
| 836 | * @param array $messageOptions |
||
| 837 | * @param bool $endSession |
||
| 838 | * @return Result |
||
| 839 | * @throws Client\Exception |
||
| 840 | * @throws Client\Struct\InvalidArgumentException |
||
| 841 | * @throws Client\InvalidMessageException |
||
| 842 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 843 | * @throws \RuntimeException |
||
| 844 | * @throws \InvalidArgumentException |
||
| 845 | * @throws \SoapFault |
||
| 846 | */ |
||
| 847 | protected function callMessage($messageName, $options, $messageOptions, $endSession = false) |
||
| 867 | |||
| 868 | /** |
||
| 869 | * Make message options |
||
| 870 | * |
||
| 871 | * Message options are meta options when sending a message to the amadeus web services |
||
| 872 | * - (if stateful) should we end the current session after sending this call? |
||
| 873 | * - ... ? |
||
| 874 | * |
||
| 875 | * @param array $incoming The Message options chosen by the caller - if any. |
||
| 876 | * @param bool $endSession Switch if you want to terminate the current session after making the call. |
||
| 877 | * @return array |
||
| 878 | */ |
||
| 879 | protected function makeMessageOptions(array $incoming, $endSession = false) |
||
| 891 | |||
| 892 | /** |
||
| 893 | * Load the session handler |
||
| 894 | * |
||
| 895 | * Either load the provided session handler or create one depending on incoming parameters. |
||
| 896 | * |
||
| 897 | * @param HandlerInterface|null $sessionHandler |
||
| 898 | * @param Params\SessionHandlerParams $params |
||
| 899 | * @return HandlerInterface |
||
| 900 | */ |
||
| 901 | protected function loadSessionHandler($sessionHandler, $params) |
||
| 913 | |||
| 914 | /** |
||
| 915 | * Load a request creator |
||
| 916 | * |
||
| 917 | * A request creator is responsible for generating the correct request to send. |
||
| 918 | * |
||
| 919 | * @param RequestCreatorInterface|null $requestCreator |
||
| 920 | * @param Params\RequestCreatorParams $params |
||
| 921 | * @param string $libIdentifier Library identifier & version string (for Received From) |
||
| 922 | * @param string $originatorOffice The Office we are signed in with. |
||
| 923 | * @param array $mesVer Messages & Versions array of active messages in the WSDL |
||
| 924 | * @return RequestCreatorInterface |
||
| 925 | * @throws \RuntimeException |
||
| 926 | */ |
||
| 927 | protected function loadRequestCreator($requestCreator, $params, $libIdentifier, $originatorOffice, $mesVer) |
||
| 945 | |||
| 946 | /** |
||
| 947 | * Load a response handler |
||
| 948 | * |
||
| 949 | * @param ResponseHandlerInterface|null $responseHandler |
||
| 950 | * |
||
| 951 | * @return ResponseHandlerInterface |
||
| 952 | * @throws \RuntimeException |
||
| 953 | */ |
||
| 954 | protected function loadResponseHandler($responseHandler) |
||
| 966 | } |
||
| 967 |
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: