@@ -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 | } |
@@ -434,7 +434,7 @@ |
||
434 | 434 | if ($item instanceof Type\ItemIdType) { |
435 | 435 | $item = $item->toArray(); |
436 | 436 | } |
437 | - $item = (array)$item; |
|
437 | + $item = (array) $item; |
|
438 | 438 | $itemIds[] = array( |
439 | 439 | 'Id' => $item['Id'], |
440 | 440 | 'ChangeKey' => $item['ChangeKey'] |
@@ -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 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | protected function createClient($server, $auth, $options) |
253 | 253 | { |
254 | - $location = 'https://' . $this->cleanServerUrl($server) . '/EWS/Exchange.asmx'; |
|
254 | + $location = 'https://'.$this->cleanServerUrl($server).'/EWS/Exchange.asmx'; |
|
255 | 255 | |
256 | 256 | $options = array_replace_recursive([ |
257 | 257 | 'version' => self::VERSION_2007, |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $this->soap = new NTLMSoapClient( |
268 | 268 | $location, |
269 | 269 | $auth, |
270 | - dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', |
|
270 | + dirname(__FILE__).'/../../Resources/wsdl/services.wsdl', |
|
271 | 271 | $options |
272 | 272 | ); |
273 | 273 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | |
339 | 339 | $server = $url['host']; |
340 | 340 | if (isset($url['port'])) { |
341 | - $server .= ':' . $url['port']; |
|
341 | + $server .= ':'.$url['port']; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | if (isset($url['path'])) { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | } |
456 | 456 | |
457 | 457 | if ($code >= 300) { |
458 | - throw new ExchangeException('SOAP client returned status of ' . $code, $code); |
|
458 | + throw new ExchangeException('SOAP client returned status of '.$code, $code); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | if (empty($response) || empty($response->getNonNullResponseMessages())) { |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | self::$middlewareStack = [ |
472 | 472 | //Make the actual SOAP call |
473 | - function (MiddlewareRequest $request) { |
|
473 | + function(MiddlewareRequest $request) { |
|
474 | 474 | $client = $this->getClient(); |
475 | 475 | $response = $client->__call($request->getName(), $request->getArguments()); |
476 | 476 | $response = MiddlewareResponse::newResponse($response); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | }, |
480 | 480 | |
481 | 481 | //Transform an objcet of type Type to an XML Object |
482 | - function (MiddlewareRequest $request, callable $next) { |
|
482 | + function(MiddlewareRequest $request, callable $next) { |
|
483 | 483 | if ($request->getRequest() instanceof Type) { |
484 | 484 | $request->setRequest($request->getRequest()->toXmlObject()); |
485 | 485 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | }, |
489 | 489 | |
490 | 490 | //The SyncScope option isn't available for Exchange 2007 SP1 and below |
491 | - function (MiddlewareRequest $request, callable $next) { |
|
491 | + function(MiddlewareRequest $request, callable $next) { |
|
492 | 492 | $options = $request->getOptions(); |
493 | 493 | $version2007SP1 = ($options['version'] == ExchangeWebServices::VERSION_2007 |
494 | 494 | || $options['version'] == ExchangeWebServices::VERSION_2007_SP1); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | }, |
505 | 505 | |
506 | 506 | //Add response processing |
507 | - function (MiddlewareRequest $request, callable $next) { |
|
507 | + function(MiddlewareRequest $request, callable $next) { |
|
508 | 508 | $response = $next($request); |
509 | 509 | |
510 | 510 | $response->setResponse($this->processResponse($response->getResponse())); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | }, |
514 | 514 | |
515 | 515 | //Adds last request to FindFolder and FindItem responses |
516 | - function (MiddlewareRequest $request, callable $next) { |
|
516 | + function(MiddlewareRequest $request, callable $next) { |
|
517 | 517 | $response = $next($request); |
518 | 518 | |
519 | 519 | $responseObject = $response->getResponse(); |
@@ -540,14 +540,14 @@ discard block |
||
540 | 540 | $newStack = []; |
541 | 541 | foreach ($middlewareStack as $key => $current) { |
542 | 542 | /** @var $current callable */ |
543 | - $last = function () { }; |
|
543 | + $last = function() { }; |
|
544 | 544 | |
545 | 545 | if ($key != 0) { |
546 | 546 | $last = $newStack[$key - 1]; |
547 | 547 | } |
548 | 548 | |
549 | 549 | $current = Closure::bind($current, $this); |
550 | - $newStack[] = function (MiddlewareRequest $request) use ($current, $last) { |
|
550 | + $newStack[] = function(MiddlewareRequest $request) use ($current, $last) { |
|
551 | 551 | return $current($request, $last); |
552 | 552 | }; |
553 | 553 | } |