@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $this->checkMessageIsInWsdl($messageName); |
| 97 | 97 | |
| 98 | - $methodName = 'create' . str_replace("_", "", $messageName); |
|
| 98 | + $methodName = 'create'.str_replace("_", "", $messageName); |
|
| 99 | 99 | |
| 100 | 100 | if (method_exists($this, $methodName)) { |
| 101 | 101 | return $this->$methodName($params); |
| 102 | 102 | } else { |
| 103 | - throw new \RuntimeException('Message ' . $methodName . ' is not implemented in ' . __CLASS__); |
|
| 103 | + throw new \RuntimeException('Message '.$methodName.' is not implemented in '.__CLASS__); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | protected function checkMessageIsInWsdl($messageName) |
| 428 | 428 | { |
| 429 | 429 | if (!array_key_exists($messageName, $this->messagesAndVersions)) { |
| 430 | - throw new InvalidMessageException('Message "' . $messageName . '" is not in WDSL'); |
|
| 430 | + throw new InvalidMessageException('Message "'.$messageName.'" is not in WDSL'); |
|
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | |
@@ -59,6 +59,6 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | protected static function makeReceivedFrom($original, $libIdentifier) |
| 61 | 61 | { |
| 62 | - return $original . " " . $libIdentifier; |
|
| 62 | + return $original." ".$libIdentifier; |
|
| 63 | 63 | } |
| 64 | 64 | } |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function __doRequest($request, $location, $action, $version, $oneWay = null) |
| 75 | 75 | { |
| 76 | - if (!extension_loaded ('xsl')) { |
|
| 76 | + if (!extension_loaded('xsl')) { |
|
| 77 | 77 | throw new Exception('PHP XSL extension is not enabled.'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $newRequest = $this->transformIncomingRequest( $request); |
|
| 80 | + $newRequest = $this->transformIncomingRequest($request); |
|
| 81 | 81 | |
| 82 | 82 | return parent::__doRequest($newRequest, $location, $action, $version, $oneWay); |
| 83 | 83 | } |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $newRequest = null; |
| 93 | 93 | |
| 94 | - $xsltFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . self::REMOVE_EMPTY_XSLT_LOCATION; |
|
| 94 | + $xsltFile = dirname(__FILE__).DIRECTORY_SEPARATOR.self::REMOVE_EMPTY_XSLT_LOCATION; |
|
| 95 | 95 | if (!is_readable($xsltFile)) { |
| 96 | - throw new Exception('XSLT file "' . $xsltFile . '" is not readable!'); |
|
| 96 | + throw new Exception('XSLT file "'.$xsltFile.'" is not readable!'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if ($transform === false) { |
| 109 | 109 | $this->logger->log( |
| 110 | 110 | Log\LogLevel::ERROR, |
| 111 | - __METHOD__ . "__doRequest(): XSLTProcessor::transformToXml " |
|
| 111 | + __METHOD__."__doRequest(): XSLTProcessor::transformToXml " |
|
| 112 | 112 | . "returned FALSE: could not perform transformation!!" |
| 113 | 113 | ); |
| 114 | 114 | $newRequest = $request; |
@@ -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 | } |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | public function __construct(SessionHandlerParams $params) |
| 181 | 181 | { |
| 182 | 182 | $this->params = $params; |
| 183 | - if($params->logger instanceof LoggerInterface) { |
|
| 183 | + if ($params->logger instanceof LoggerInterface) { |
|
| 184 | 184 | $this->setLogger($params->logger); |
| 185 | - $this->log(LogLevel::INFO, __METHOD__. "(): Logger started."); |
|
| 185 | + $this->log(LogLevel::INFO, __METHOD__."(): Logger started."); |
|
| 186 | 186 | } |
| 187 | 187 | if ($params->overrideSoapClient instanceof \SoapClient) { |
| 188 | 188 | $this->soapClient = $params->overrideSoapClient; |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $this->handlePostMessage($messageName, $this->getLastResponse(), $messageOptions, $result); |
| 217 | 217 | |
| 218 | - } catch(\SoapFault $ex) { |
|
| 218 | + } catch (\SoapFault $ex) { |
|
| 219 | 219 | $this->log( |
| 220 | 220 | LogLevel::ERROR, |
| 221 | - "SOAPFAULT while sending message " . $messageName . ": " . |
|
| 222 | - $ex->getMessage() . " code: " .$ex->getCode() . " at " . $ex->getFile() . |
|
| 223 | - " line " . $ex->getLine() . ": \n" . $ex->getTraceAsString() |
|
| 221 | + "SOAPFAULT while sending message ".$messageName.": ". |
|
| 222 | + $ex->getMessage()." code: ".$ex->getCode()." at ".$ex->getFile(). |
|
| 223 | + " line ".$ex->getLine().": \n".$ex->getTraceAsString() |
|
| 224 | 224 | ); |
| 225 | 225 | $this->logRequestAndResponse($messageName); |
| 226 | 226 | $result->exception = $ex; |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | // is unreadable |
| 230 | 230 | $this->log( |
| 231 | 231 | LogLevel::ERROR, |
| 232 | - "EXCEPTION while sending message " . $messageName . ": " . |
|
| 233 | - $ex->getMessage() . " at " . $ex->getFile() . " line " . $ex->getLine() . ": \n" . |
|
| 232 | + "EXCEPTION while sending message ".$messageName.": ". |
|
| 233 | + $ex->getMessage()." at ".$ex->getFile()." line ".$ex->getLine().": \n". |
|
| 234 | 234 | $ex->getTraceAsString() |
| 235 | 235 | ); |
| 236 | 236 | $this->logRequestAndResponse($messageName); |
@@ -345,8 +345,8 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | protected function extractMessageVersion($fullVersionString) |
| 347 | 347 | { |
| 348 | - $secondUnderscore = strpos($fullVersionString, '_', strpos($fullVersionString, '_')+1); |
|
| 349 | - $num = substr($fullVersionString, $secondUnderscore+1); |
|
| 348 | + $secondUnderscore = strpos($fullVersionString, '_', strpos($fullVersionString, '_') + 1); |
|
| 349 | + $num = substr($fullVersionString, $secondUnderscore + 1); |
|
| 350 | 350 | |
| 351 | 351 | return str_replace('_', '.', $num); |
| 352 | 352 | } |
@@ -421,11 +421,11 @@ discard block |
||
| 421 | 421 | { |
| 422 | 422 | $this->log( |
| 423 | 423 | LogLevel::INFO, |
| 424 | - 'Called ' . $messageName . ' with request: ' . $this->getSoapClient()->__getLastRequest() |
|
| 424 | + 'Called '.$messageName.' with request: '.$this->getSoapClient()->__getLastRequest() |
|
| 425 | 425 | ); |
| 426 | 426 | $this->log( |
| 427 | 427 | LogLevel::INFO, |
| 428 | - 'Response: ' . $this->getSoapClient()->__getLastResponse() |
|
| 428 | + 'Response: '.$this->getSoapClient()->__getLastResponse() |
|
| 429 | 429 | ); |
| 430 | 430 | } |
| 431 | 431 | |
@@ -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 | |