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) |
||
| 116 | |||
| 117 | /** |
||
| 118 | * @return bool |
||
| 119 | */ |
||
| 120 | public function isStateful() |
||
| 124 | |||
| 125 | /** |
||
| 126 | * Get the last raw XML message that was sent out |
||
| 127 | * |
||
| 128 | * @return string|null |
||
| 129 | */ |
||
| 130 | public function getLastRequest() |
||
| 134 | |||
| 135 | /** |
||
| 136 | * Get the last raw XML message that was received |
||
| 137 | * |
||
| 138 | * @return string|null |
||
| 139 | */ |
||
| 140 | public function getLastResponse() |
||
| 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() |
||
| 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) |
||
| 171 | |||
| 172 | /** |
||
| 173 | * Construct Amadeus Web Services client |
||
| 174 | * |
||
| 175 | * @param Params $params |
||
| 176 | */ |
||
| 177 | public function __construct($params) |
||
| 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() |
||
| 227 | |||
| 228 | /** |
||
| 229 | * Terminate a session - only applicable to non-stateless mode. |
||
| 230 | * |
||
| 231 | * @return Result |
||
| 232 | * @throws Exception |
||
| 233 | */ |
||
| 234 | public function securitySignOut() |
||
| 245 | |||
| 246 | /** |
||
| 247 | * PNR_Retrieve - Retrieve an Amadeus PNR by record locator |
||
| 248 | * |
||
| 249 | * @param RequestOptions\PnrRetrieveOptions $options |
||
| 250 | * @param array $messageOptions (OPTIONAL) |
||
| 251 | * @return Result |
||
| 252 | * @throws Exception |
||
| 253 | */ |
||
| 254 | public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = []) |
||
| 260 | |||
| 261 | /** |
||
| 262 | * Create a PNR using PNR_AddMultiElements |
||
| 263 | * |
||
| 264 | * @param RequestOptions\PnrCreatePnrOptions $options |
||
| 265 | * @param array $messageOptions (OPTIONAL) |
||
| 266 | * @return Result |
||
| 267 | */ |
||
| 268 | public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = []) |
||
| 274 | |||
| 275 | /** |
||
| 276 | * PNR_AddMultiElements - Create a new PNR or update an existing PNR. |
||
| 277 | * |
||
| 278 | * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional |
||
| 279 | * |
||
| 280 | * @param RequestOptions\PnrAddMultiElementsOptions $options |
||
| 281 | * @param array $messageOptions (OPTIONAL) |
||
| 282 | * @return Result |
||
| 283 | */ |
||
| 284 | public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = []) |
||
| 290 | |||
| 291 | /** |
||
| 292 | * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info |
||
| 293 | * |
||
| 294 | * This extra info is info you cannot see in the regular PNR, like Offers. |
||
| 295 | * |
||
| 296 | * By default, the result will be the PNR_RetrieveAndDisplayReply XML as string. |
||
| 297 | * That way you can easily parse the PNR's contents with XPath. |
||
| 298 | * |
||
| 299 | * Set $messageOptions['asString'] = FALSE to get the response as a PHP object. |
||
| 300 | * |
||
| 301 | * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional |
||
| 302 | * |
||
| 303 | * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR |
||
| 304 | * @param array $messageOptions (OPTIONAL) |
||
| 305 | * @return Result |
||
| 306 | * @throws Exception |
||
| 307 | **/ |
||
| 308 | public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = []) |
||
| 314 | |||
| 315 | /** |
||
| 316 | * PNR_Cancel |
||
| 317 | * |
||
| 318 | * @param RequestOptions\PnrCancelOptions $options |
||
| 319 | * @param array $messageOptions (OPTIONAL) |
||
| 320 | * @return Result |
||
| 321 | */ |
||
| 322 | public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = []) |
||
| 328 | |||
| 329 | /** |
||
| 330 | * PNR_DisplayHistory |
||
| 331 | * |
||
| 332 | * @param RequestOptions\PnrDisplayHistoryOptions $options |
||
| 333 | * @param array $messageOptions (OPTIONAL) |
||
| 334 | * @return Result |
||
| 335 | */ |
||
| 336 | public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = []) |
||
| 342 | |||
| 343 | /** |
||
| 344 | * PNR_TransferOwnership |
||
| 345 | * |
||
| 346 | * @param RequestOptions\PnrTransferOwnershipOptions $options |
||
| 347 | * @param array $messageOptions (OPTIONAL) |
||
| 348 | * @return Result |
||
| 349 | */ |
||
| 350 | public function pnrTransferOwnership(RequestOptions\PnrTransferOwnershipOptions $options, $messageOptions = []) |
||
| 356 | |||
| 357 | /** |
||
| 358 | * Queue_List - get a list of all PNR's on a given queue |
||
| 359 | * |
||
| 360 | * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional |
||
| 361 | * |
||
| 362 | * @param RequestOptions\QueueListOptions $options |
||
| 363 | * @param array $messageOptions (OPTIONAL) |
||
| 364 | * @return Result |
||
| 365 | */ |
||
| 366 | public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = []) |
||
| 372 | |||
| 373 | /** |
||
| 374 | * Queue_PlacePNR - Place a PNR on a given queue |
||
| 375 | * |
||
| 376 | * @param RequestOptions\QueuePlacePnrOptions $options |
||
| 377 | * @param array $messageOptions (OPTIONAL) |
||
| 378 | * @return Result |
||
| 379 | */ |
||
| 380 | public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = []) |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Queue_RemoveItem - remove an item (a PNR) from a given queue |
||
| 389 | * |
||
| 390 | * @param RequestOptions\QueueRemoveItemOptions $options |
||
| 391 | * @param array $messageOptions (OPTIONAL) |
||
| 392 | * @return Result |
||
| 393 | */ |
||
| 394 | public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = []) |
||
| 400 | |||
| 401 | /** |
||
| 402 | * Queue_MoveItem - move an item (a PNR) from one queue to another. |
||
| 403 | * |
||
| 404 | * @param RequestOptions\QueueMoveItemOptions $options |
||
| 405 | * @param array $messageOptions (OPTIONAL) |
||
| 406 | * @return Result |
||
| 407 | */ |
||
| 408 | public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = []) |
||
| 414 | |||
| 415 | /** |
||
| 416 | * Offer_CreateOffer |
||
| 417 | * |
||
| 418 | * @param RequestOptions\OfferCreateOptions $options |
||
| 419 | * @param array $messageOptions (OPTIONAL) |
||
| 420 | * @return Result |
||
| 421 | */ |
||
| 422 | public function offerCreate(RequestOptions\OfferCreateOptions $options, $messageOptions = []) |
||
| 428 | |||
| 429 | /** |
||
| 430 | * Offer_VerifyOffer |
||
| 431 | * |
||
| 432 | * To be called in the context of an open PNR |
||
| 433 | * |
||
| 434 | * @param RequestOptions\OfferVerifyOptions $options |
||
| 435 | * @param array $messageOptions (OPTIONAL) |
||
| 436 | * @return Result |
||
| 437 | */ |
||
| 438 | public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = []) |
||
| 444 | |||
| 445 | /** |
||
| 446 | * Offer_ConfirmAirOffer |
||
| 447 | * |
||
| 448 | * @param RequestOptions\OfferConfirmAirOptions $options |
||
| 449 | * @param array $messageOptions (OPTIONAL) |
||
| 450 | * @return Result |
||
| 451 | */ |
||
| 452 | public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = []) |
||
| 458 | |||
| 459 | /** |
||
| 460 | * Offer_ConfirmHotelOffer |
||
| 461 | * |
||
| 462 | * @param RequestOptions\OfferConfirmHotelOptions $options |
||
| 463 | * @param array $messageOptions (OPTIONAL) |
||
| 464 | * @return Result |
||
| 465 | */ |
||
| 466 | public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = []) |
||
| 472 | |||
| 473 | /** |
||
| 474 | * Offer_ConfirmCarOffer |
||
| 475 | * |
||
| 476 | * @param RequestOptions\OfferConfirmCarOptions $options |
||
| 477 | * @param array $messageOptions (OPTIONAL) |
||
| 478 | * @return Result |
||
| 479 | */ |
||
| 480 | public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = []) |
||
| 486 | |||
| 487 | /** |
||
| 488 | * Fare_MasterPricerTravelBoardSearch |
||
| 489 | * |
||
| 490 | * @param RequestOptions\FareMasterPricerTbSearch $options |
||
| 491 | * @param array $messageOptions (OPTIONAL) |
||
| 492 | * @return Result |
||
| 493 | */ |
||
| 494 | public function fareMasterPricerTravelBoardSearch( |
||
| 502 | |||
| 503 | /** |
||
| 504 | * Fare_MasterPricerCalendar |
||
| 505 | * |
||
| 506 | * @param RequestOptions\FareMasterPricerCalendarOptions $options |
||
| 507 | * @param array $messageOptions (OPTIONAL) |
||
| 508 | * @return Result |
||
| 509 | */ |
||
| 510 | public function fareMasterPricerCalendar( |
||
| 518 | |||
| 519 | /** |
||
| 520 | * Fare_PricePnrWithBookingClass |
||
| 521 | * |
||
| 522 | * @param RequestOptions\FarePricePnrWithBookingClassOptions $options |
||
| 523 | * @param array $messageOptions (OPTIONAL) |
||
| 524 | * @return Result |
||
| 525 | */ |
||
| 526 | public function farePricePnrWithBookingClass( |
||
| 534 | |||
| 535 | /** |
||
| 536 | * Fare_PricePnrWithLowerFares |
||
| 537 | * |
||
| 538 | * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options |
||
| 539 | * @param array $messageOptions (OPTIONAL) |
||
| 540 | * @return Result |
||
| 541 | */ |
||
| 542 | public function farePricePnrWithLowerFares( |
||
| 550 | |||
| 551 | /** |
||
| 552 | * Fare_PricePnrWithLowestFare |
||
| 553 | * |
||
| 554 | * @param RequestOptions\FarePricePnrWithLowestFareOptions $options |
||
| 555 | * @param array $messageOptions (OPTIONAL) |
||
| 556 | * @return Result |
||
| 557 | */ |
||
| 558 | public function farePricePnrWithLowestFare( |
||
| 566 | |||
| 567 | /** |
||
| 568 | * Fare_InformativePricingWithoutPNR |
||
| 569 | * |
||
| 570 | * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options |
||
| 571 | * @param array $messageOptions (OPTIONAL) |
||
| 572 | * @return Result |
||
| 573 | */ |
||
| 574 | public function fareInformativePricingWithoutPnr( |
||
| 582 | |||
| 583 | /** |
||
| 584 | * Fare_InformativeBestPricingWithoutPNR |
||
| 585 | * |
||
| 586 | * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options |
||
| 587 | * @param array $messageOptions (OPTIONAL) |
||
| 588 | * @return Result |
||
| 589 | */ |
||
| 590 | public function fareInformativeBestPricingWithoutPnr( |
||
| 598 | |||
| 599 | /** |
||
| 600 | * Fare_CheckRules |
||
| 601 | * |
||
| 602 | * @param RequestOptions\FareCheckRulesOptions $options |
||
| 603 | * @param array $messageOptions (OPTIONAL) |
||
| 604 | * @return Result |
||
| 605 | */ |
||
| 606 | public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = []) |
||
| 612 | |||
| 613 | /** |
||
| 614 | * Fare_ConvertCurrency |
||
| 615 | * |
||
| 616 | * @param RequestOptions\FareConvertCurrencyOptions $options |
||
| 617 | * @param array $messageOptions (OPTIONAL) |
||
| 618 | * @return Result |
||
| 619 | */ |
||
| 620 | public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = []) |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Air_MultiAvailability |
||
| 629 | * |
||
| 630 | * @param RequestOptions\AirMultiAvailabilityOptions $options |
||
| 631 | * @param array $messageOptions (OPTIONAL) |
||
| 632 | * @return Result |
||
| 633 | */ |
||
| 634 | public function airMultiAvailability( |
||
| 642 | |||
| 643 | /** |
||
| 644 | * Air_SellFromRecommendation |
||
| 645 | * |
||
| 646 | * @param RequestOptions\AirSellFromRecommendationOptions $options |
||
| 647 | * @param array $messageOptions (OPTIONAL) |
||
| 648 | * @return Result |
||
| 649 | */ |
||
| 650 | public function airSellFromRecommendation( |
||
| 658 | |||
| 659 | /** |
||
| 660 | * Air_FlightInfo |
||
| 661 | * |
||
| 662 | * @param RequestOptions\AirFlightInfoOptions $options |
||
| 663 | * @param array $messageOptions (OPTIONAL) |
||
| 664 | * @return Result |
||
| 665 | */ |
||
| 666 | public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = []) |
||
| 672 | |||
| 673 | /** |
||
| 674 | * Air_RetrieveSeatMap |
||
| 675 | * |
||
| 676 | * @param RequestOptions\AirRetrieveSeatMapOptions $options |
||
| 677 | * @param array $messageOptions (OPTIONAL) |
||
| 678 | * @return Result |
||
| 679 | */ |
||
| 680 | public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = []) |
||
| 686 | |||
| 687 | /** |
||
| 688 | * Command_Cryptic |
||
| 689 | * |
||
| 690 | * @param RequestOptions\CommandCrypticOptions $options |
||
| 691 | * @param array $messageOptions (OPTIONAL) |
||
| 692 | * @return Result |
||
| 693 | */ |
||
| 694 | public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = []) |
||
| 700 | |||
| 701 | /** |
||
| 702 | * MiniRule_GetFromPricingRec |
||
| 703 | * |
||
| 704 | * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options |
||
| 705 | * @param array $messageOptions (OPTIONAL) |
||
| 706 | * @return Result |
||
| 707 | */ |
||
| 708 | public function miniRuleGetFromPricingRec( |
||
| 716 | |||
| 717 | /** |
||
| 718 | * MiniRule_GetFromPricing |
||
| 719 | * |
||
| 720 | * @param RequestOptions\MiniRuleGetFromPricingOptions $options |
||
| 721 | * @param array $messageOptions (OPTIONAL) |
||
| 722 | * @return Result |
||
| 723 | */ |
||
| 724 | public function miniRuleGetFromPricing( |
||
| 732 | |||
| 733 | /** |
||
| 734 | * Info_EncodeDecodeCity |
||
| 735 | * |
||
| 736 | * @param RequestOptions\InfoEncodeDecodeCityOptions $options |
||
| 737 | * @param array $messageOptions (OPTIONAL) |
||
| 738 | * @return Result |
||
| 739 | */ |
||
| 740 | public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = []) |
||
| 746 | |||
| 747 | |||
| 748 | /** |
||
| 749 | * Ticket_CreateTSTFromPricing |
||
| 750 | * |
||
| 751 | * @param RequestOptions\TicketCreateTstFromPricingOptions $options |
||
| 752 | * @param array $messageOptions (OPTIONAL) |
||
| 753 | * @return Result |
||
| 754 | */ |
||
| 755 | public function ticketCreateTSTFromPricing( |
||
| 763 | |||
| 764 | /** |
||
| 765 | * Ticket_CreateTSMFromPricing |
||
| 766 | * |
||
| 767 | * @param RequestOptions\TicketCreateTsmFromPricingOptions $options |
||
| 768 | * @param array $messageOptions (OPTIONAL) |
||
| 769 | * @return Result |
||
| 770 | */ |
||
| 771 | public function ticketCreateTSMFromPricing( |
||
| 779 | |||
| 780 | /** |
||
| 781 | * Ticket_DeleteTST |
||
| 782 | * |
||
| 783 | * @param RequestOptions\TicketDeleteTstOptions $options |
||
| 784 | * @param array $messageOptions (OPTIONAL) |
||
| 785 | * @return Result |
||
| 786 | */ |
||
| 787 | public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = []) |
||
| 793 | |||
| 794 | /** |
||
| 795 | * Ticket_DisplayTST |
||
| 796 | * |
||
| 797 | * @param RequestOptions\TicketDisplayTstOptions $options |
||
| 798 | * @param array $messageOptions (OPTIONAL) |
||
| 799 | * @return Result |
||
| 800 | */ |
||
| 801 | public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = []) |
||
| 807 | |||
| 808 | /** |
||
| 809 | * DocIssuance_IssueTicket |
||
| 810 | * |
||
| 811 | * @param RequestOptions\DocIssuanceIssueTicketOptions $options |
||
| 812 | * @param array $messageOptions (OPTIONAL) |
||
| 813 | * @return Result |
||
| 814 | */ |
||
| 815 | public function docIssuanceIssueTicket( |
||
| 823 | |||
| 824 | /** |
||
| 825 | * PriceXplorer_ExtremeSearch |
||
| 826 | * |
||
| 827 | * @param RequestOptions\PriceXplorerExtremeSearchOptions $options |
||
| 828 | * @param array $messageOptions (OPTIONAL) |
||
| 829 | * @return Result |
||
| 830 | */ |
||
| 831 | public function priceXplorerExtremeSearch( |
||
| 839 | |||
| 840 | /** |
||
| 841 | * SalesReports_DisplayQueryReport |
||
| 842 | * |
||
| 843 | * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options |
||
| 844 | * @param array $messageOptions (OPTIONAL) |
||
| 845 | * @return Result |
||
| 846 | */ |
||
| 847 | public function salesReportsDisplayQueryReport( |
||
| 855 | |||
| 856 | /** |
||
| 857 | * Service_IntegratedPricing |
||
| 858 | * |
||
| 859 | * @param RequestOptions\ServiceIntegratedPricingOptions $options |
||
| 860 | * @param array $messageOptions (OPTIONAL) |
||
| 861 | * @return Result |
||
| 862 | */ |
||
| 863 | public function serviceIntegratedPricing( |
||
| 871 | |||
| 872 | /** |
||
| 873 | * Call a message with the given parameters |
||
| 874 | * |
||
| 875 | * @param string $messageName |
||
| 876 | * @param RequestOptions\RequestOptionsInterface $options |
||
| 877 | * @param array $messageOptions |
||
| 878 | * @param bool $endSession |
||
| 879 | * @return Result |
||
| 880 | * @throws Client\Exception |
||
| 881 | * @throws Client\Struct\InvalidArgumentException |
||
| 882 | * @throws Client\InvalidMessageException |
||
| 883 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
| 884 | * @throws \RuntimeException |
||
| 885 | * @throws \InvalidArgumentException |
||
| 886 | * @throws \SoapFault |
||
| 887 | */ |
||
| 888 | protected function callMessage($messageName, $options, $messageOptions, $endSession = false) |
||
| 908 | |||
| 909 | /** |
||
| 910 | * Make message options |
||
| 911 | * |
||
| 912 | * Message options are meta options when sending a message to the amadeus web services |
||
| 913 | * - (if stateful) should we end the current session after sending this call? |
||
| 914 | * - ... ? |
||
| 915 | * |
||
| 916 | * @param array $incoming The Message options chosen by the caller - if any. |
||
| 917 | * @param bool $endSession Switch if you want to terminate the current session after making the call. |
||
| 918 | * @return array |
||
| 919 | */ |
||
| 920 | protected function makeMessageOptions(array $incoming, $endSession = false) |
||
| 932 | |||
| 933 | /** |
||
| 934 | * Load the session handler |
||
| 935 | * |
||
| 936 | * Either load the provided session handler or create one depending on incoming parameters. |
||
| 937 | * |
||
| 938 | * @param HandlerInterface|null $sessionHandler |
||
| 939 | * @param Params\SessionHandlerParams|null $params |
||
| 940 | * @return HandlerInterface |
||
| 941 | */ |
||
| 942 | protected function loadSessionHandler($sessionHandler, $params) |
||
| 952 | |||
| 953 | /** |
||
| 954 | * Load a request creator |
||
| 955 | * |
||
| 956 | * A request creator is responsible for generating the correct request to send. |
||
| 957 | * |
||
| 958 | * @param RequestCreatorInterface|null $requestCreator |
||
| 959 | * @param Params\RequestCreatorParams $params |
||
| 960 | * @param string $libIdentifier Library identifier & version string (for Received From) |
||
| 961 | * @param string $originatorOffice The Office we are signed in with. |
||
| 962 | * @param array $mesVer Messages & Versions array of active messages in the WSDL |
||
| 963 | * @return RequestCreatorInterface |
||
| 964 | * @throws \RuntimeException |
||
| 965 | */ |
||
| 966 | protected function loadRequestCreator($requestCreator, $params, $libIdentifier, $originatorOffice, $mesVer) |
||
| 982 | |||
| 983 | /** |
||
| 984 | * Load a response handler |
||
| 985 | * |
||
| 986 | * @param ResponseHandlerInterface|null $responseHandler |
||
| 987 | * @return ResponseHandlerInterface |
||
| 988 | * @throws \RuntimeException |
||
| 989 | */ |
||
| 990 | protected function loadResponseHandler($responseHandler) |
||
| 1000 | } |
||
| 1001 |