@@ -33,17 +33,17 @@ |
||
| 33 | 33 | class PassengerDef extends LoadParamsFromArray |
| 34 | 34 | { |
| 35 | 35 | /** |
| 36 | - * https://webservices.amadeus.com/extranet/structures/viewMessageStructure.do?id=2326&serviceVersionId=2298&isQuery=true# |
|
| 37 | - * |
|
| 38 | - * Offer_CreateOffer/airPricingRecommendation/paxReference/passengerReference/type |
|
| 39 | - * Reference qualifier codesets |
|
| 40 | - * Value Description |
|
| 41 | - * P Passenger/traveller reference number |
|
| 42 | - * PA Adult Passenger |
|
| 43 | - * PI Infant Passenger |
|
| 36 | + * https://webservices.amadeus.com/extranet/structures/viewMessageStructure.do?id=2326&serviceVersionId=2298&isQuery=true# |
|
| 37 | + * |
|
| 38 | + * Offer_CreateOffer/airPricingRecommendation/paxReference/passengerReference/type |
|
| 39 | + * Reference qualifier codesets |
|
| 40 | + * Value Description |
|
| 41 | + * P Passenger/traveller reference number |
|
| 42 | + * PA Adult Passenger |
|
| 43 | + * PI Infant Passenger |
|
| 44 | 44 | * |
| 45 | 45 | * @var string |
| 46 | - */ |
|
| 46 | + */ |
|
| 47 | 47 | public $passengerType = "P"; |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | default: |
| 62 | 62 | //TODO implement Client::HEADER_V1 |
| 63 | 63 | throw new \InvalidArgumentException( |
| 64 | - 'No Session Handler found for soapHeaderVersion ' . $handlerParams->soapHeaderVersion |
|
| 64 | + 'No Session Handler found for soapHeaderVersion '.$handlerParams->soapHeaderVersion |
|
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | if ($sessionId) { |
| 123 | 123 | $newSessionData['sessionId'] = $sessionId; |
| 124 | 124 | } |
| 125 | - $sequence = (int)$responseDomDoc->getElementsByTagName(self::NODENAME_SEQENCENR)->item(0)->nodeValue; |
|
| 125 | + $sequence = (int) $responseDomDoc->getElementsByTagName(self::NODENAME_SEQENCENR)->item(0)->nodeValue; |
|
| 126 | 126 | if ($sequence) { |
| 127 | 127 | $newSessionData['sequenceNumber'] = $sequence; |
| 128 | 128 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $password = base64_decode($params->authParams->passwordData); |
| 222 | 222 | $creation = new \DateTime('now', new \DateTimeZone('UTC')); |
| 223 | 223 | $t = microtime(true); |
| 224 | - $micro = sprintf("%03d",($t - floor($t)) * 1000); |
|
| 224 | + $micro = sprintf("%03d", ($t - floor($t)) * 1000); |
|
| 225 | 225 | $creationString = $this->createDateTimeStringForAuth($creation, $micro); |
| 226 | 226 | $messageNonce = $this->generateUniqueNonce($params->authParams->nonceBase, $creationString); |
| 227 | 227 | $encodedNonce = base64_encode($messageNonce); |
@@ -277,8 +277,7 @@ discard block |
||
| 277 | 277 | //We are authenticated and stateful: provide session header to continue or terminate session |
| 278 | 278 | $statusCode = |
| 279 | 279 | (isset($messageOptions['endSession']) && $messageOptions['endSession'] === true) ? |
| 280 | - "End" : |
|
| 281 | - "InSeries"; |
|
| 280 | + "End" : "InSeries"; |
|
| 282 | 281 | |
| 283 | 282 | array_push( |
| 284 | 283 | $headersToSet, |
@@ -335,15 +334,15 @@ discard block |
||
| 335 | 334 | if (function_exists('com_create_guid')) { |
| 336 | 335 | return com_create_guid(); |
| 337 | 336 | } else { |
| 338 | - mt_srand((double)microtime()*10000); |
|
| 337 | + mt_srand((double) microtime() * 10000); |
|
| 339 | 338 | $charId = strtoupper(md5(uniqid(rand(), true))); |
| 340 | 339 | $hyphen = chr(45); // "-" |
| 341 | 340 | |
| 342 | - $uuid = substr($charId, 0, 8) . $hyphen |
|
| 343 | - .substr($charId, 8, 4) . $hyphen |
|
| 344 | - .substr($charId,12, 4) . $hyphen |
|
| 345 | - .substr($charId,16, 4) . $hyphen |
|
| 346 | - .substr($charId,20,12); |
|
| 341 | + $uuid = substr($charId, 0, 8).$hyphen |
|
| 342 | + .substr($charId, 8, 4).$hyphen |
|
| 343 | + .substr($charId, 12, 4).$hyphen |
|
| 344 | + .substr($charId, 16, 4).$hyphen |
|
| 345 | + .substr($charId, 20, 12); |
|
| 347 | 346 | |
| 348 | 347 | return $uuid; |
| 349 | 348 | } |
@@ -360,10 +359,10 @@ discard block |
||
| 360 | 359 | { |
| 361 | 360 | return $xml = '<oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
| 362 | 361 | <oas:UsernameToken xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" oas1:Id="UsernameToken-1"> |
| 363 | - <oas:Username>' . $originator . '</oas:Username> |
|
| 364 | - <oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">' . $nonce . '</oas:Nonce> |
|
| 365 | - <oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">' . $pwDigest . '</oas:Password> |
|
| 366 | - <oas1:Created>' . $creationTimeString . '</oas1:Created> |
|
| 362 | + <oas:Username>' . $originator.'</oas:Username> |
|
| 363 | + <oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">' . $nonce.'</oas:Nonce> |
|
| 364 | + <oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">' . $pwDigest.'</oas:Password> |
|
| 365 | + <oas1:Created>' . $creationTimeString.'</oas1:Created> |
|
| 367 | 366 | </oas:UsernameToken> |
| 368 | 367 | </oas:Security>'; |
| 369 | 368 | } |
@@ -378,7 +377,7 @@ discard block |
||
| 378 | 377 | { |
| 379 | 378 | return substr( |
| 380 | 379 | sha1( |
| 381 | - $nonceBase . $creationString, |
|
| 380 | + $nonceBase.$creationString, |
|
| 382 | 381 | true |
| 383 | 382 | ), |
| 384 | 383 | 0, |
@@ -406,7 +405,7 @@ discard block |
||
| 406 | 405 | */ |
| 407 | 406 | protected function generatePasswordDigest($password, $creationString, $messageNonce) |
| 408 | 407 | { |
| 409 | - return base64_encode(sha1($messageNonce . $creationString . sha1($password, true), true)); |
|
| 408 | + return base64_encode(sha1($messageNonce.$creationString.sha1($password, true), true)); |
|
| 410 | 409 | } |
| 411 | 410 | |
| 412 | 411 | /** |
@@ -417,7 +416,7 @@ discard block |
||
| 417 | 416 | protected function createDateTimeStringForAuth($creationDateTime, $micro) |
| 418 | 417 | { |
| 419 | 418 | $creationDateTime->setTimezone(new \DateTimeZone('UTC')); |
| 420 | - return $creationDateTime->format("Y-m-d\TH:i:s:") . $micro . 'Z'; |
|
| 419 | + return $creationDateTime->format("Y-m-d\TH:i:s:").$micro.'Z'; |
|
| 421 | 420 | } |
| 422 | 421 | |
| 423 | 422 | /** |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | const REFQUAL_OTHER_TATTOO = "O"; |
| 38 | 38 | const REFQUAL_PASSENGER_TATTOO = "PT"; |
| 39 | 39 | const REFQUAL_SEGMENT_TATTOO_SUBTATTOO = "SS"; |
| 40 | - const REFQUAL_SEGMENT_TATTOO= "ST"; |
|
| 40 | + const REFQUAL_SEGMENT_TATTOO = "ST"; |
|
| 41 | 41 | const REFQUAL_PASSENGER_CLIENT_REQUEST_MESSAGE = "PR"; |
| 42 | 42 | const REFQUAL_SEGMENT_CLIENT_REQUEST_MESSAGE = "SR"; |
| 43 | 43 | |
@@ -58,23 +58,23 @@ |
||
| 58 | 58 | * Original Issue / Issue in Exchange For element |
| 59 | 59 | */ |
| 60 | 60 | const SEGNAME_ORIGINAL_ISSUE = "FO"; |
| 61 | - const SEGNAME_FORM_OF_PAYMENT= "FP"; |
|
| 62 | - const SEGNAME_FERRY= "FRR"; |
|
| 61 | + const SEGNAME_FORM_OF_PAYMENT = "FP"; |
|
| 62 | + const SEGNAME_FERRY = "FRR"; |
|
| 63 | 63 | const SEGNAME_MISCELLANEOUS_TICKETING_INFORMATION = "FS"; |
| 64 | 64 | const SEGNAME_TOUR_CODE = "FT"; |
| 65 | 65 | const SEGNAME_TICKETING_CARRIER_DESIGNATOR = "FV"; |
| 66 | 66 | const SEGNAME_MISCELLANEOUS_INFORMATION = "FZ"; |
| 67 | 67 | const SEGNAME_NON_AUTOMATED_AY_DIRECT_ACCESS_HOTEL = "HAY"; |
| 68 | - const SEGNAME_AUTOMATED_HOTEL_AUXILIARY= "HHL"; |
|
| 68 | + const SEGNAME_AUTOMATED_HOTEL_AUXILIARY = "HHL"; |
|
| 69 | 69 | const SEGNAME_NON_AUTOMATED_HOTEL_AUXILIARY = "HU"; |
| 70 | - const SEGNAME_GROUP_NAME= "NG"; |
|
| 71 | - const SEGNAME_OPTION= "OP"; |
|
| 70 | + const SEGNAME_GROUP_NAME = "NG"; |
|
| 71 | + const SEGNAME_OPTION = "OP"; |
|
| 72 | 72 | const SEGNAME_OTHER_SPECIAL_INFORMATION = "OS"; |
| 73 | - const SEGNAME_PRIORITY_LINE= "PL"; |
|
| 73 | + const SEGNAME_PRIORITY_LINE = "PL"; |
|
| 74 | 74 | const SEGNAME_CONFIDENTIAL_REMARK = "RC"; |
| 75 | 75 | const SEGNAME_RECEIVE_FROM = "RF"; |
| 76 | 76 | const SEGNAME_INVOICE_REMARK = "RI"; |
| 77 | - const SEGNAME_GENERAL_REMARK= "RM"; |
|
| 77 | + const SEGNAME_GENERAL_REMARK = "RM"; |
|
| 78 | 78 | const SEGNAME_QUALITY_CONTROL_REMARK = "RQ"; |
| 79 | 79 | const SEGNAME_ASSOCIATED_CROSS_REFERENCE_RECORD = "RR"; |
| 80 | 80 | const SEGNAME_NON_AUTOMATED_MISCELLANEOUS_AUXILIARY = "RU"; |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | $params->paymentDetails->ccExpiry |
| 131 | 131 | ); |
| 132 | 132 | } else { |
| 133 | - throw new InvalidArgumentException('Hotel Offer Confirm Form of Payment ' . $params->formOfPayment . ' is not yet supported'); |
|
| 133 | + throw new InvalidArgumentException('Hotel Offer Confirm Form of Payment '.$params->formOfPayment.' is not yet supported'); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | throw new \RuntimeException('NOT YET IMPLEMENTED'); |
| 224 | 224 | break; |
| 225 | 225 | default: |
| 226 | - throw new InvalidArgumentException('Segment type ' . $segmentType . ' is not supported'); |
|
| 226 | + throw new InvalidArgumentException('Segment type '.$segmentType.' is not supported'); |
|
| 227 | 227 | break; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $createdElement->frequentTravellerData = new FrequentTravellerData($element); |
| 503 | 503 | break; |
| 504 | 504 | default: |
| 505 | - throw new InvalidArgumentException('Element type ' . $elementType . ' is not supported'); |
|
| 505 | + throw new InvalidArgumentException('Element type '.$elementType.' is not supported'); |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | if (!empty($element->references)) { |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * @param array|null $requestOptions |
|
| 137 | + * @param string[] $requestOptions |
|
| 138 | 138 | */ |
| 139 | 139 | protected function loadRequestOptions($requestOptions) |
| 140 | 140 | { |