@@ -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 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | if (is_array($value)) { |
11 | - return array_map(function ($value) { |
|
11 | + return array_map(function($value) { |
|
12 | 12 | return cloneValue($value); |
13 | 13 | }, $value); |
14 | 14 | } |
@@ -123,7 +123,7 @@ |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | if (is_array($property)) { |
126 | - return array_map(function ($property) { |
|
126 | + return array_map(function($property) { |
|
127 | 127 | if ($property instanceof Type) { |
128 | 128 | return $property->toXmlObject(); |
129 | 129 | } |
@@ -358,8 +358,8 @@ discard block |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
361 | - * @param $majorVersion |
|
362 | - * @param $minorVersion |
|
361 | + * @param string $majorVersion |
|
362 | + * @param string $minorVersion |
|
363 | 363 | * @return bool|mixed |
364 | 364 | */ |
365 | 365 | protected function parseVersionBefore2013($majorVersion, $minorVersion) |
@@ -387,6 +387,11 @@ discard block |
||
387 | 387 | return constant(ExchangeWebServices::class . "::$constant"); |
388 | 388 | } |
389 | 389 | |
390 | + /** |
|
391 | + * @param string $majorVersion |
|
392 | + * @param string $minorVersion |
|
393 | + * @param string $buildVersion |
|
394 | + */ |
|
390 | 395 | protected function parseVersionAfter2013($majorVersion, $minorVersion, $buildVersion) |
391 | 396 | { |
392 | 397 | if ($minorVersion >= 1) { |
@@ -384,7 +384,7 @@ |
||
384 | 384 | $constant .= "_SP$minorVersion"; |
385 | 385 | } |
386 | 386 | |
387 | - return constant(ExchangeWebServices::class . "::$constant"); |
|
387 | + return constant(ExchangeWebServices::class."::$constant"); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | protected function parseVersionAfter2013($majorVersion, $minorVersion, $buildVersion) |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public static function handlePullNotification($uri, callable $handle, array $options = array()) |
10 | 10 | { |
11 | 11 | $server = new \SoapServer( |
12 | - __DIR__ . '/../Resources/wsdl/notification-service.wsdl', |
|
12 | + __DIR__.'/../Resources/wsdl/notification-service.wsdl', |
|
13 | 13 | [ |
14 | 14 | 'uri' => $uri, |
15 | 15 | 'classmap' => ClassMap::getClassMap(), |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use garethp\ews\API\ClassMap; |
6 | 6 | use garethp\ews\API\Type\BaseFolderIdType; |
7 | -use garethp\ews\API\Type\FolderIdType; |
|
8 | 7 | |
9 | 8 | class NotificationAPI extends API |
10 | 9 | { |
@@ -95,6 +95,10 @@ discard block |
||
95 | 95 | return $this->client; |
96 | 96 | } |
97 | 97 | |
98 | + /** |
|
99 | + * @param string $username |
|
100 | + * @param string $password |
|
101 | + */ |
|
98 | 102 | public static function withUsernameAndPassword($server, $username, $password, $options = []) |
99 | 103 | { |
100 | 104 | return new static(ExchangeWebServices::fromUsernameAndPassword( |
@@ -190,6 +194,9 @@ discard block |
||
190 | 194 | return $this->createFolders($names, $parentFolder, $options, 'IPF.Contact'); |
191 | 195 | } |
192 | 196 | |
197 | + /** |
|
198 | + * @param string $folderClass |
|
199 | + */ |
|
193 | 200 | public function createFolders($names, FolderIdType $parentFolder, $options = array(), $folderClass = null) |
194 | 201 | { |
195 | 202 | $names = Utilities\ensureIsArray($names); |
@@ -278,7 +285,7 @@ discard block |
||
278 | 285 | |
279 | 286 | /** |
280 | 287 | * @param $identifier |
281 | - * @return Type\BaseFolderType |
|
288 | + * @return Type |
|
282 | 289 | */ |
283 | 290 | public function getFolder($identifier) |
284 | 291 | { |
@@ -299,7 +306,7 @@ discard block |
||
299 | 306 | * Get a folder by it's distinguishedId |
300 | 307 | * |
301 | 308 | * @param string $distinguishedId |
302 | - * @return Type\BaseFolderType |
|
309 | + * @return Type |
|
303 | 310 | */ |
304 | 311 | public function getFolderByDistinguishedId($distinguishedId) |
305 | 312 | { |
@@ -313,7 +320,7 @@ discard block |
||
313 | 320 | |
314 | 321 | /** |
315 | 322 | * @param $folderId |
316 | - * @return Type\BaseFolderType |
|
323 | + * @return Type |
|
317 | 324 | */ |
318 | 325 | public function getFolderByFolderId($folderId) |
319 | 326 | { |
@@ -325,7 +332,7 @@ discard block |
||
325 | 332 | /** |
326 | 333 | * @param string|FolderIdType $parentFolderId |
327 | 334 | * @param array $options |
328 | - * @return Type\BaseFolderType[] |
|
335 | + * @return Type |
|
329 | 336 | */ |
330 | 337 | public function getChildrenFolders($parentFolderId = 'root', $options = array()) |
331 | 338 | { |
@@ -397,7 +404,7 @@ discard block |
||
397 | 404 | * @param FolderIdType $folderId |
398 | 405 | * @param null $syncState |
399 | 406 | * @param array $options |
400 | - * @return SyncFolderItemsResponseMessageType |
|
407 | + * @return Type |
|
401 | 408 | */ |
402 | 409 | public function listItemChanges($folderId, $syncState = null, $options = array()) |
403 | 410 | { |
@@ -492,7 +499,7 @@ discard block |
||
492 | 499 | * @param string $deleteType |
493 | 500 | * @param bool $deleteSubFolders |
494 | 501 | * @param array $options |
495 | - * @return EmptyFolderResponseType |
|
502 | + * @return Type |
|
496 | 503 | */ |
497 | 504 | public function emptyFolder( |
498 | 505 | FolderIdType $folderId, |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | public function createFolders($names, FolderIdType $parentFolder, $options = array(), $folderClass = null) |
194 | 194 | { |
195 | 195 | $names = Utilities\ensureIsArray($names); |
196 | - $names = array_map(function ($name) use ($folderClass) { |
|
196 | + $names = array_map(function($name) use ($folderClass) { |
|
197 | 197 | return ['DisplayName' => $name, 'FolderClass' => $folderClass]; |
198 | 198 | }, $names); |
199 | 199 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | { |
258 | 258 | $items = Utilities\ensureIsArray($items, true); |
259 | 259 | |
260 | - $items = array_map(function ($item) { |
|
260 | + $items = array_map(function($item) { |
|
261 | 261 | $item = Type\ItemIdType::buildFromArray($item); |
262 | 262 | |
263 | 263 | return $item->toArray(); |
@@ -8,11 +8,11 @@ |
||
8 | 8 | { |
9 | 9 | $folders = ensureIsArray($folderIds); |
10 | 10 | |
11 | - $folderIds = array_map(function (BaseFolderIdType $folderId) { |
|
11 | + $folderIds = array_map(function(BaseFolderIdType $folderId) { |
|
12 | 12 | return $folderId->toArray(true); |
13 | 13 | }, $folders); |
14 | 14 | |
15 | - return array_reduce($folderIds, function ($folderIds, $folderId) { |
|
15 | + return array_reduce($folderIds, function($folderIds, $folderId) { |
|
16 | 16 | $folderIds[key($folderId)][] = current($folderId); |
17 | 17 | return $folderIds; |
18 | 18 | }, []); |