@@ -70,36 +70,36 @@ |
||
| 70 | 70 | { |
| 71 | 71 | return [ |
| 72 | 72 | 'DateTime' => [ |
| 73 | - 'string' => function ($value) { |
|
| 73 | + 'string' => function($value) { |
|
| 74 | 74 | return new \DateTime($value); |
| 75 | 75 | } |
| 76 | 76 | ], |
| 77 | 77 | 'dateTime' => [ |
| 78 | - 'string' => function ($value) { |
|
| 78 | + 'string' => function($value) { |
|
| 79 | 79 | return new \DateTime($value); |
| 80 | 80 | } |
| 81 | 81 | ], |
| 82 | 82 | 'date' => [ |
| 83 | - 'string' => function ($value) { |
|
| 83 | + 'string' => function($value) { |
|
| 84 | 84 | return new \DateTime($value); |
| 85 | 85 | } |
| 86 | 86 | ], |
| 87 | 87 | 'time' => [ |
| 88 | - 'string' => function ($value) { |
|
| 88 | + 'string' => function($value) { |
|
| 89 | 89 | return new \DateTime($value); |
| 90 | 90 | } |
| 91 | 91 | ], |
| 92 | 92 | 'ExchangeFormat' => [ |
| 93 | - 'DateTime' => function ($value) { |
|
| 93 | + 'DateTime' => function($value) { |
|
| 94 | 94 | return $value->format('c'); |
| 95 | 95 | }, |
| 96 | - 'dateTime' => function ($value) { |
|
| 96 | + 'dateTime' => function($value) { |
|
| 97 | 97 | return $value->format('c'); |
| 98 | 98 | }, |
| 99 | - 'date' => function ($value) { |
|
| 99 | + 'date' => function($value) { |
|
| 100 | 100 | return $value->format('Y-m-d'); |
| 101 | 101 | }, |
| 102 | - 'time' => function ($value) { |
|
| 102 | + 'time' => function($value) { |
|
| 103 | 103 | return $value->format('H:i:s'); |
| 104 | 104 | } |
| 105 | 105 | ] |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(__DIR__ . "/../vendor/autoload.php"); |
|
| 3 | +require_once(__DIR__."/../vendor/autoload.php"); |
|
| 4 | 4 | |
| 5 | 5 | use Symfony\Component\Console\Application; |
| 6 | 6 | use jamesiarmes\PEWS\Generator\ConvertToPHP; |
| 7 | 7 | |
| 8 | -error_reporting(error_reporting() &~E_NOTICE); |
|
| 8 | +error_reporting(error_reporting() & ~E_NOTICE); |
|
| 9 | 9 | |
| 10 | 10 | $cli = new Application('Convert XSD to PHP classes Command Line Interface', "2.0"); |
| 11 | 11 | $cli->setCatchExceptions(true); |
@@ -23,12 +23,12 @@ |
||
| 23 | 23 | //should have your own way to get it, but just for the sake of example I'm going to show you a way to do that |
| 24 | 24 | |
| 25 | 25 | if (!$_SESSION['token'] && !isset($_GET)) { |
| 26 | - $redirect = $authorizationEndpoint . |
|
| 27 | - '?response_type=code' . |
|
| 28 | - '&client_id=' . urlencode($clientId) . |
|
| 29 | - '&redirect_uri=' . urlencode($redirectUri) . |
|
| 30 | - '&resource=' . urlencode($resource) . |
|
| 31 | - '&scope=' . urlencode('full_access_as_user'); |
|
| 26 | + $redirect = $authorizationEndpoint. |
|
| 27 | + '?response_type=code'. |
|
| 28 | + '&client_id='.urlencode($clientId). |
|
| 29 | + '&redirect_uri='.urlencode($redirectUri). |
|
| 30 | + '&resource='.urlencode($resource). |
|
| 31 | + '&scope='.urlencode('full_access_as_user'); |
|
| 32 | 32 | header("Location: {$redirect}"); |
| 33 | 33 | exit(); |
| 34 | 34 | } |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | $headers[] = $this->ewsHeaders['timezone']; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $headers = array_filter($headers, function ($header) { |
|
| 117 | + $headers = array_filter($headers, function($header) { |
|
| 118 | 118 | if (!($header instanceof SoapHeader)) { |
| 119 | 119 | return false; |
| 120 | 120 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - throw new \Exception('Property ' . $names[0] . ' does not exist'); |
|
| 118 | + throw new \Exception('Property '.$names[0].' does not exist'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (!$this->exists($name)) { |
| 133 | - throw new \Exception('Property ' . $name . ' does not exist'); |
|
| 133 | + throw new \Exception('Property '.$name.' does not exist'); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $name; |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | if (is_array($property)) { |
| 128 | - $property = array_map(function ($property) { |
|
| 128 | + $property = array_map(function($property) { |
|
| 129 | 129 | if ($property instanceof Type) { |
| 130 | 130 | return $property->toXmlObject(); |
| 131 | 131 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public static function getSoapCall() |
| 15 | 15 | { |
| 16 | - return function (MiddlewareRequest $request) { |
|
| 16 | + return function(MiddlewareRequest $request) { |
|
| 17 | 17 | $client = $this->getClient(); |
| 18 | 18 | $response = $client->__call($request->getName(), $request->getArguments()); |
| 19 | 19 | $response = MiddlewareResponse::newResponse($response); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public static function getTypeToXMLObject() |
| 26 | 26 | { |
| 27 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 27 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 28 | 28 | if ($request->getRequest() instanceof Type) { |
| 29 | 29 | $request->setRequest($request->getRequest()->toXmlObject()); |
| 30 | 30 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public static function getStripSyncScopeForExchange2007() |
| 37 | 37 | { |
| 38 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 38 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 39 | 39 | $options = $request->getOptions(); |
| 40 | 40 | $version2007SP1 = ($options['version'] == ExchangeWebServices::VERSION_2007 |
| 41 | 41 | || $options['version'] == ExchangeWebServices::VERSION_2007_SP1); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public static function getProcessResponse() |
| 55 | 55 | { |
| 56 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 56 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 57 | 57 | $response = $next($request); |
| 58 | 58 | |
| 59 | 59 | $response->setResponse($this->processResponse($response->getResponse())); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public static function getAddLastRequestToPagedResults() |
| 66 | 66 | { |
| 67 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 67 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 68 | 68 | $response = $next($request); |
| 69 | 69 | |
| 70 | 70 | $responseObject = $response->getResponse(); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | protected function createClient($server, $auth, $options) |
| 255 | 255 | { |
| 256 | - $location = 'https://' . $this->cleanServerUrl($server) . '/EWS/Exchange.asmx'; |
|
| 256 | + $location = 'https://'.$this->cleanServerUrl($server).'/EWS/Exchange.asmx'; |
|
| 257 | 257 | |
| 258 | 258 | $options = array_replace_recursive([ |
| 259 | 259 | 'version' => self::VERSION_2007, |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $this->soap = new NTLMSoapClient( |
| 270 | 270 | $location, |
| 271 | 271 | $auth, |
| 272 | - dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', |
|
| 272 | + dirname(__FILE__).'/../../Resources/wsdl/services.wsdl', |
|
| 273 | 273 | $options |
| 274 | 274 | ); |
| 275 | 275 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | $server = $url['host']; |
| 329 | 329 | if (isset($url['port'])) { |
| 330 | - $server .= ':' . $url['port']; |
|
| 330 | + $server .= ':'.$url['port']; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | if (isset($url['path'])) { |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | if ($code >= 300) { |
| 447 | - throw new ExchangeException('SOAP client returned status of ' . $code, $code); |
|
| 447 | + throw new ExchangeException('SOAP client returned status of '.$code, $code); |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | if (empty($response) || empty($response->getNonNullResponseMessages())) { |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $newStack = []; |
| 487 | 487 | foreach ($middlewareStack as $key => $current) { |
| 488 | 488 | /** @var $current callable */ |
| 489 | - $last = function () { |
|
| 489 | + $last = function() { |
|
| 490 | 490 | }; |
| 491 | 491 | |
| 492 | 492 | if ($key != 0) { |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | $current = Closure::bind($current, $this, $this); |
| 497 | - $newStack[] = function (MiddlewareRequest $request) use ($current, $last) { |
|
| 497 | + $newStack[] = function(MiddlewareRequest $request) use ($current, $last) { |
|
| 498 | 498 | return $current($request, $last); |
| 499 | 499 | }; |
| 500 | 500 | } |
@@ -266,14 +266,14 @@ |
||
| 266 | 266 | $this->server = $server; |
| 267 | 267 | $this->version = $options['version']; |
| 268 | 268 | |
| 269 | - $backup = libxml_disable_entity_loader(false); |
|
| 269 | + $backup = libxml_disable_entity_loader(false); |
|
| 270 | 270 | $this->soap = new NTLMSoapClient( |
| 271 | 271 | $location, |
| 272 | 272 | $auth, |
| 273 | 273 | dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', |
| 274 | 274 | $options |
| 275 | 275 | ); |
| 276 | - libxml_disable_entity_loader($backup); |
|
| 276 | + libxml_disable_entity_loader($backup); |
|
| 277 | 277 | |
| 278 | 278 | if (isset($options['primarySmtpEmailAddress'])) { |
| 279 | 279 | $this->setPrimarySmtpEmailAddress($options['primarySmtpEmailAddress']); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $names = array($names); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $names = array_map(function ($name) { |
|
| 189 | + $names = array_map(function($name) { |
|
| 190 | 190 | return array( |
| 191 | 191 | 'DisplayName' => $name, |
| 192 | 192 | 'FolderClass' => 'IPF.Appointment' |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $names = array($names); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - $names = array_map(function ($name) { |
|
| 213 | + $names = array_map(function($name) { |
|
| 214 | 214 | return ['DisplayName' => $name]; |
| 215 | 215 | }, $names); |
| 216 | 216 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $folders = array($folders); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $folderIds = array_map(function ($folderId) { |
|
| 250 | + $folderIds = array_map(function($folderId) { |
|
| 251 | 251 | return $folderId->toArray(); |
| 252 | 252 | }, $folders); |
| 253 | 253 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $items = array($items); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - $items = array_map(function ($item) { |
|
| 288 | + $items = array_map(function($item) { |
|
| 289 | 289 | $item = Type\ItemIdType::buildFromArray($item); |
| 290 | 290 | |
| 291 | 291 | return $item->toArray(); |