@@ -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 | ] |
@@ -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; |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | $mailId = $return = $api->sendMail($message, array('MessageDisposition' => 'SaveOnly')); |
| 20 | 20 | |
| 21 | 21 | //Create our Attachments |
| 22 | -$api->getClient()->CreateAttachment(array ( |
|
| 22 | +$api->getClient()->CreateAttachment(array( |
|
| 23 | 23 | 'ParentItemId' => $mailId->toArray(), |
| 24 | - 'Attachments' => array ( |
|
| 25 | - 'FileAttachment' => array ( |
|
| 24 | + 'Attachments' => array( |
|
| 25 | + 'FileAttachment' => array( |
|
| 26 | 26 | 'Name' => 'picture.jpg', |
| 27 | 27 | 'Content' => file_get_contents('picture.jpg') |
| 28 | 28 | ) |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | $mailId = $api->getItem($mailId)->getItemId(); |
| 36 | 36 | |
| 37 | 37 | //Send the message |
| 38 | -$api->getClient()->SendItem(array ( |
|
| 38 | +$api->getClient()->SendItem(array( |
|
| 39 | 39 | 'SaveItemToFolder' => true, |
| 40 | - 'ItemIds' => array ( |
|
| 40 | + 'ItemIds' => array( |
|
| 41 | 41 | 'ItemId' => $mailId->toArray() |
| 42 | 42 | ) |
| 43 | 43 | )); |
@@ -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 garethp\ews\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 | } //Once you have your code, you can exchange it for a token. The code can only be used once, so you don't store the code. |
@@ -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, |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $this->soap = new NTLMSoapClient( |
| 271 | 271 | $location, |
| 272 | 272 | $auth, |
| 273 | - dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', |
|
| 273 | + dirname(__FILE__).'/../../Resources/wsdl/services.wsdl', |
|
| 274 | 274 | $options |
| 275 | 275 | ); |
| 276 | 276 | libxml_disable_entity_loader($backup); |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | $server = $url['host']; |
| 331 | 331 | if (isset($url['port'])) { |
| 332 | - $server .= ':' . $url['port']; |
|
| 332 | + $server .= ':'.$url['port']; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | if (isset($url['path'])) { |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | if ($code >= 300) { |
| 452 | - throw new ExchangeException('SOAP client returned status of ' . $code, $code); |
|
| 452 | + throw new ExchangeException('SOAP client returned status of '.$code, $code); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | if (empty($response) || empty($response->getNonNullResponseMessages())) { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $newStack = []; |
| 492 | 492 | foreach ($middlewareStack as $key => $current) { |
| 493 | 493 | /** @var $current callable */ |
| 494 | - $last = function () { |
|
| 494 | + $last = function() { |
|
| 495 | 495 | }; |
| 496 | 496 | |
| 497 | 497 | if ($key != 0) { |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | $current = Closure::bind($current, $this, $this); |
| 502 | - $newStack[] = function (MiddlewareRequest $request) use ($current, $last) { |
|
| 502 | + $newStack[] = function(MiddlewareRequest $request) use ($current, $last) { |
|
| 503 | 503 | return $current($request, $last); |
| 504 | 504 | }; |
| 505 | 505 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public 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 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 function getStripSyncScopeForExchange2007() |
| 37 | 37 | { |
| 38 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 38 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 39 | 39 | $requestObj = $request->getRequest(); |
| 40 | 40 | |
| 41 | 41 | if ($request->getName() == "SyncFolderItems" |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function getProcessResponse() |
| 53 | 53 | { |
| 54 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 54 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 55 | 55 | $response = $next($request); |
| 56 | 56 | |
| 57 | 57 | $response->setResponse($this->processResponse($response->getResponse())); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function getAddLastRequestToPagedResults() |
| 64 | 64 | { |
| 65 | - return function (MiddlewareRequest $request, callable $next) { |
|
| 65 | + return function(MiddlewareRequest $request, callable $next) { |
|
| 66 | 66 | $response = $next($request); |
| 67 | 67 | |
| 68 | 68 | $responseObject = $response->getResponse(); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | ], |
| 307 | 307 | ]; |
| 308 | 308 | |
| 309 | - $users = array_map(function ($user) { |
|
| 309 | + $users = array_map(function($user) { |
|
| 310 | 310 | return [ |
| 311 | 311 | 'Email' => ['Address' => $user], |
| 312 | 312 | 'AttendeeType' => 'Required', |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | ]]); |
| 339 | 339 | $availability = $this->getAvailabilityFor($startTime, $endTime, $users, $options); |
| 340 | 340 | |
| 341 | - $availabilities = array_map(function (FreeBusyResponseType $freeBusyResponseType) { |
|
| 341 | + $availabilities = array_map(function(FreeBusyResponseType $freeBusyResponseType) { |
|
| 342 | 342 | return str_split($freeBusyResponseType->getFreeBusyView()->getMergedFreeBusy()); |
| 343 | 343 | }, $availability->getFreeBusyResponseArray()->FreeBusyResponse); |
| 344 | 344 | |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $headers[] = $this->ewsHeaders['timezone']; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $headers = array_filter($headers, function ($header) { |
|
| 113 | + $headers = array_filter($headers, function($header) { |
|
| 114 | 114 | return $header instanceof SoapHeader; |
| 115 | 115 | }); |
| 116 | 116 | |