@@ -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 | { |
@@ -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 | }, []); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @param Type\BaseFolderIdType $folderId |
| 75 | 75 | * @param array $options |
| 76 | - * @return Type\MessageType[] |
|
| 76 | + * @return Type |
|
| 77 | 77 | */ |
| 78 | 78 | public function getMailItems($folderId = null, $options = array()) |
| 79 | 79 | { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @param Type\BaseFolderIdType $folderId |
| 104 | 104 | * @param array $options |
| 105 | - * @return Type\MessageType[] |
|
| 105 | + * @return Type |
|
| 106 | 106 | */ |
| 107 | 107 | public function getUnreadMailItems($folderId = null, $options = array()) |
| 108 | 108 | { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | 196 | * @param array $options |
| 197 | - * @return API\Message\EmptyFolderResponseType |
|
| 197 | + * @return Type |
|
| 198 | 198 | */ |
| 199 | 199 | public function emptyTrash(array $options = []) |
| 200 | 200 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | public function createFolders($names, BaseFolderIdType $parentFolder, $options = array(), $folderClass = null) |
| 193 | 193 | { |
| 194 | 194 | $names = Utilities\ensureIsArray($names); |
| 195 | - $names = array_map(function ($name) use ($folderClass) { |
|
| 195 | + $names = array_map(function($name) use ($folderClass) { |
|
| 196 | 196 | return ['DisplayName' => $name, 'FolderClass' => $folderClass]; |
| 197 | 197 | }, $names); |
| 198 | 198 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | { |
| 257 | 257 | $items = Utilities\ensureIsArray($items, true); |
| 258 | 258 | |
| 259 | - $items = array_map(function ($item) { |
|
| 259 | + $items = array_map(function($item) { |
|
| 260 | 260 | $item = Type\ItemIdType::buildFromArray($item); |
| 261 | 261 | |
| 262 | 262 | return $item->toArray(); |
@@ -94,6 +94,10 @@ discard block |
||
| 94 | 94 | return $this->client; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | + /** |
|
| 98 | + * @param string $username |
|
| 99 | + * @param string $password |
|
| 100 | + */ |
|
| 97 | 101 | public static function withUsernameAndPassword($server, $username, $password, $options = []) |
| 98 | 102 | { |
| 99 | 103 | return new static(ExchangeWebServices::fromUsernameAndPassword( |
@@ -189,6 +193,9 @@ discard block |
||
| 189 | 193 | return $this->createFolders($names, $parentFolder, $options, 'IPF.Contact'); |
| 190 | 194 | } |
| 191 | 195 | |
| 196 | + /** |
|
| 197 | + * @param string $folderClass |
|
| 198 | + */ |
|
| 192 | 199 | public function createFolders($names, BaseFolderIdType $parentFolder, $options = array(), $folderClass = null) |
| 193 | 200 | { |
| 194 | 201 | $names = Utilities\ensureIsArray($names); |
@@ -278,7 +285,7 @@ discard block |
||
| 278 | 285 | /** |
| 279 | 286 | * @param $identifier |
| 280 | 287 | * @param array $options |
| 281 | - * @return Type\BaseFolderType |
|
| 288 | + * @return Type |
|
| 282 | 289 | */ |
| 283 | 290 | public function getFolder($identifier, $options = []) |
| 284 | 291 | { |
@@ -303,7 +310,7 @@ discard block |
||
| 303 | 310 | * |
| 304 | 311 | * @param string $distinguishedId |
| 305 | 312 | * @param array $options |
| 306 | - * @return Type\BaseFolderType |
|
| 313 | + * @return Type |
|
| 307 | 314 | */ |
| 308 | 315 | public function getFolderByDistinguishedId($distinguishedId, $options = []) |
| 309 | 316 | { |
@@ -318,7 +325,7 @@ discard block |
||
| 318 | 325 | /** |
| 319 | 326 | * @param string|BaseFolderIdType $folderId |
| 320 | 327 | * @param array $options |
| 321 | - * @return Type\BaseFolderType |
|
| 328 | + * @return Type |
|
| 322 | 329 | * @throws API\Exception |
| 323 | 330 | */ |
| 324 | 331 | public function getFolderByFolderId($folderId, $options = []) |
@@ -335,7 +342,7 @@ discard block |
||
| 335 | 342 | /** |
| 336 | 343 | * @param string|BaseFolderIdType $parentFolderId |
| 337 | 344 | * @param array $options |
| 338 | - * @return Type\BaseFolderType[] |
|
| 345 | + * @return Type |
|
| 339 | 346 | */ |
| 340 | 347 | public function getChildrenFolders($parentFolderId = 'root', array $options = array()) |
| 341 | 348 | { |
@@ -405,7 +412,7 @@ discard block |
||
| 405 | 412 | * @param BaseFolderIdType $folderId |
| 406 | 413 | * @param null $syncState |
| 407 | 414 | * @param array $options |
| 408 | - * @return SyncFolderItemsResponseMessageType |
|
| 415 | + * @return Type |
|
| 409 | 416 | */ |
| 410 | 417 | public function listItemChanges($folderId, $syncState = null, array $options = array()) |
| 411 | 418 | { |
@@ -500,7 +507,7 @@ discard block |
||
| 500 | 507 | * @param string $deleteType |
| 501 | 508 | * @param bool $deleteSubFolders |
| 502 | 509 | * @param array $options |
| 503 | - * @return EmptyFolderResponseType |
|
| 510 | + * @return Type |
|
| 504 | 511 | */ |
| 505 | 512 | public function emptyFolder( |
| 506 | 513 | BaseFolderIdType $folderId, |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * Get a list of calendar items between two dates/times |
| 88 | 88 | * |
| 89 | - * @param string|DateTime $start |
|
| 90 | - * @param string|DateTime $end |
|
| 89 | + * @param string $start |
|
| 90 | + * @param string $end |
|
| 91 | 91 | * @param array $options |
| 92 | - * @return CalendarItemType[]|Type\FindItemParentType |
|
| 92 | + * @return Type |
|
| 93 | 93 | */ |
| 94 | 94 | public function getCalendarItems($start = '12:00 AM', $end = '11:59 PM', $options = array()) |
| 95 | 95 | { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param $id |
| 123 | 123 | * @param $changeKey |
| 124 | 124 | * @param array $options |
| 125 | - * @return Type\CalendarItemType |
|
| 125 | + * @return Type |
|
| 126 | 126 | */ |
| 127 | 127 | public function getCalendarItem($id, $changeKey, $options = []) |
| 128 | 128 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * |
| 190 | 190 | * @param null $syncState |
| 191 | 191 | * @param array $options |
| 192 | - * @return API\Message\SyncFolderItemsResponseMessageType |
|
| 192 | + * @return Type |
|
| 193 | 193 | */ |
| 194 | 194 | public function listChanges($syncState = null, $options = array()) |
| 195 | 195 | { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @param array $users |
| 252 | 252 | * @param array $options |
| 253 | 253 | * |
| 254 | - * @return API\Message\GetUserAvailabilityResponseType |
|
| 254 | + * @return Type |
|
| 255 | 255 | */ |
| 256 | 256 | public function getAvailabilityFor($startTime, $endTime, array $users, array $options = array()) |
| 257 | 257 | { |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | ], |
| 272 | 272 | ]; |
| 273 | 273 | |
| 274 | - $users = array_map(function ($user) { |
|
| 274 | + $users = array_map(function($user) { |
|
| 275 | 275 | return [ |
| 276 | 276 | 'Email' => ['Address' => $user], |
| 277 | 277 | 'AttendeeType' => 'Required', |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | throw new ExchangeException($responseMessage); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - $availabilities = array_map(function (FreeBusyResponseType $freeBusyResponseType) { |
|
| 312 | + $availabilities = array_map(function(FreeBusyResponseType $freeBusyResponseType) { |
|
| 313 | 313 | return str_split($freeBusyResponseType->getFreeBusyView()->getMergedFreeBusy()); |
| 314 | 314 | }, $availability->getFreeBusyResponseArray()->FreeBusyResponse); |
| 315 | 315 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @param Type\BaseFolderIdType $folderId |
| 59 | 59 | * @param array $options |
| 60 | - * @return Type\ContactItemType[] |
|
| 60 | + * @return Type |
|
| 61 | 61 | */ |
| 62 | 62 | public function getContacts($folderId = null, $options = array()) |
| 63 | 63 | { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * @param Type\ItemIdType $itemId |
| 85 | 85 | * @param array $options |
| 86 | - * @return Type\ContactItemType |
|
| 86 | + * @return Type |
|
| 87 | 87 | */ |
| 88 | 88 | public function getContact($itemId, $options = array()) |
| 89 | 89 | { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | private static function formatExpression($preference, $expression) |
| 21 | 21 | { |
| 22 | 22 | if (count($expression) > 1 && is_array(current($expression))) { |
| 23 | - return array_map(function ($subExpression) use ($preference) { |
|
| 23 | + return array_map(function($subExpression) use ($preference) { |
|
| 24 | 24 | return self::formatExpression($preference, $subExpression)[0]; |
| 25 | 25 | }, $expression); |
| 26 | 26 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | $formattedRestrictionType[] = array( |
| 40 | 40 | 'FieldURI' => array('FieldURI' => API\FieldURIManager::getFieldUriByName($key, $preference)), |
| 41 | - 'FieldURIOrConstant' => array('Constant' => array('Value' => (string)$value)) |
|
| 41 | + 'FieldURIOrConstant' => array('Constant' => array('Value' => (string) $value)) |
|
| 42 | 42 | ); |
| 43 | 43 | } |
| 44 | 44 | |