@@ -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 | } |
@@ -164,6 +164,10 @@ discard block |
||
| 164 | 164 | )); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | + /** |
|
| 168 | + * @param string $username |
|
| 169 | + * @param string $password |
|
| 170 | + */ |
|
| 167 | 171 | public static function withUsernameAndPassword($server, $username, $password, $options = []) |
| 168 | 172 | { |
| 169 | 173 | return new static(ExchangeWebServices::fromUsernameAndPassword( |
@@ -347,7 +351,7 @@ discard block |
||
| 347 | 351 | |
| 348 | 352 | /** |
| 349 | 353 | * @param $identifier |
| 350 | - * @return Type\BaseFolderType |
|
| 354 | + * @return Type |
|
| 351 | 355 | */ |
| 352 | 356 | public function getFolder($identifier) |
| 353 | 357 | { |
@@ -368,7 +372,7 @@ discard block |
||
| 368 | 372 | * Get a folder by it's distinguishedId |
| 369 | 373 | * |
| 370 | 374 | * @param string $distinguishedId |
| 371 | - * @return Type\BaseFolderType |
|
| 375 | + * @return Type |
|
| 372 | 376 | */ |
| 373 | 377 | public function getFolderByDistinguishedId($distinguishedId) |
| 374 | 378 | { |
@@ -382,7 +386,7 @@ discard block |
||
| 382 | 386 | |
| 383 | 387 | /** |
| 384 | 388 | * @param $folderId |
| 385 | - * @return Type\BaseFolderType |
|
| 389 | + * @return Type |
|
| 386 | 390 | */ |
| 387 | 391 | public function getFolderByFolderId($folderId) |
| 388 | 392 | { |
@@ -468,7 +472,7 @@ discard block |
||
| 468 | 472 | * @param Type\FolderIdType $folderId |
| 469 | 473 | * @param null $syncState |
| 470 | 474 | * @param array $options |
| 471 | - * @return SyncFolderItemsResponseMessageType |
|
| 475 | + * @return Type |
|
| 472 | 476 | */ |
| 473 | 477 | public function listItemChanges($folderId, $syncState = null, $options = array()) |
| 474 | 478 | { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $names = array($names); |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - $names = array_map(function ($name) { |
|
| 194 | + $names = array_map(function($name) { |
|
| 195 | 195 | return array( |
| 196 | 196 | 'DisplayName' => $name, |
| 197 | 197 | 'FolderClass' => 'IPF.Appointment' |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $names = array($names); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - $names = array_map(function ($name) { |
|
| 218 | + $names = array_map(function($name) { |
|
| 219 | 219 | return ['DisplayName' => $name]; |
| 220 | 220 | }, $names); |
| 221 | 221 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $items = array($items); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - $items = array_map(function ($item) { |
|
| 274 | + $items = array_map(function($item) { |
|
| 275 | 275 | $item = Type\ItemIdType::buildFromArray($item); |
| 276 | 276 | |
| 277 | 277 | return $item->toArray(); |
@@ -2,10 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace garethp\ews; |
| 4 | 4 | |
| 5 | -use garethp\ews\API\Enumeration\DisposalType; |
|
| 6 | -use garethp\ews\API\Enumeration\IndexBasePointType; |
|
| 7 | 5 | use garethp\ews\API\ExchangeWebServices; |
| 8 | -use garethp\ews\API\ItemUpdateBuilder; |
|
| 9 | 6 | use garethp\ews\API\Message\GetServerTimeZonesType; |
| 10 | 7 | use garethp\ews\API\Message\SyncFolderItemsResponseMessageType; |
| 11 | 8 | use garethp\ews\API\Message\UpdateItemResponseMessageType; |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | - * @param $name |
|
| 140 | + * @param string $name |
|
| 141 | 141 | * @param $value |
| 142 | 142 | * @return null |
| 143 | 143 | */ |
@@ -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 | } |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * Get a list of calendar items between two dates/times |
| 102 | 102 | * |
| 103 | - * @param string|DateTime $start |
|
| 104 | - * @param string|DateTime $end |
|
| 103 | + * @param string $start |
|
| 104 | + * @param string $end |
|
| 105 | 105 | * @param array $options |
| 106 | - * @return CalendarItemType[]|Type\FindItemParentType |
|
| 106 | + * @return Type |
|
| 107 | 107 | */ |
| 108 | 108 | public function getCalendarItems($start = '12:00 AM', $end = '11:59 PM', $options = array()) |
| 109 | 109 | { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * @param $id |
| 144 | 144 | * @param $changeKey |
| 145 | - * @return Type\CalendarItemType |
|
| 145 | + * @return Type |
|
| 146 | 146 | */ |
| 147 | 147 | public function getCalendarItem($id, $changeKey) |
| 148 | 148 | { |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @param null $syncState |
| 212 | 212 | * @param array $options |
| 213 | - * @return API\Message\SyncFolderItemsResponseMessageType |
|
| 213 | + * @return Type |
|
| 214 | 214 | */ |
| 215 | 215 | public function listChanges($syncState = null, $options = array()) |
| 216 | 216 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace garethp\ews\Calendar; |
| 4 | 4 | |
| 5 | -use garethp\ews\API\Enumeration\DisposalType; |
|
| 6 | 5 | use garethp\ews\API\Type\CalendarItemType; |
| 7 | 6 | use garethp\ews\API\Type; |
| 8 | 7 | use garethp\ews\API; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * @param Type\FolderIdType $folderId |
| 37 | 37 | * @param array $options |
| 38 | - * @return Type\ContactItemType[] |
|
| 38 | + * @return Type |
|
| 39 | 39 | */ |
| 40 | 40 | public function getContacts($folderId = null, $options = array()) |
| 41 | 41 | { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * @param Type\ItemIdType $itemId |
| 65 | - * @return Type\ContactItemType |
|
| 65 | + * @return Type |
|
| 66 | 66 | */ |
| 67 | 67 | public function getContact($itemId) |
| 68 | 68 | { |