diff --git a/src/API.php b/src/API.php index 1295f942..d42ab16b 100644 --- a/src/API.php +++ b/src/API.php @@ -26,7 +26,7 @@ class API * @param string $name * @return Calendar */ - public function getCalendar($name='default.calendar') + public function getCalendar($name = 'default.calendar') { $calendar = new Calendar(); $calendar->setClient($this->getClient()); @@ -135,7 +135,7 @@ public function getFolderByFolderId($folderId) )); } - public function getFolderByDisplayName($folderName, $parentFolder='root', $options=array()) + public function getFolderByDisplayName($folderName, $parentFolder = 'root', $options = array()) { $request = array( 'Traversal' => 'Shallow', @@ -155,15 +155,14 @@ public function getFolderByDisplayName($folderName, $parentFolder='root', $opti $folders = $response->ResponseMessages->FindFolderResponseMessage->RootFolder->Folders; $types = get_object_vars($folders); - foreach($types as $type) { - if(!is_array($type) && is_object($type) && $type->DisplayName == $folderName) { + foreach ($types as $type) { + if (!is_array($type) && is_object($type) && $type->DisplayName == $folderName) { return $type; } - if(is_array($type)) { - foreach($type as $folder) - { - if($folder->DisplayName == $folderName) { + if (is_array($type)) { + foreach ($type as $folder) { + if ($folder->DisplayName == $folderName) { return $folder; } } @@ -181,7 +180,7 @@ public function getFolderByDisplayName($folderName, $parentFolder='root', $opti * @param array $options * @return mixed */ - public function listChanges($folderId, $syncState = null, $options = array()) + public function listItemChanges($folderId, $syncState = null, $options = array()) { $request = array( 'ItemShape' => array('BaseShape' => 'IdOnly'), diff --git a/src/Calendar/Calendar.php b/src/Calendar/Calendar.php index 9587ec5f..08822c6f 100644 --- a/src/Calendar/Calendar.php +++ b/src/Calendar/Calendar.php @@ -16,12 +16,11 @@ class Calendar extends API { protected $_folderId; - public function pickCalendar($displayName='default.calendar') + public function pickCalendar($displayName = 'default.calendar') { - if($displayName == 'default.calendar') { + if ($displayName == 'default.calendar') { $folder = $this->getFolderByDistinguishedId('calendar')->CalendarFolder; - } - else { + } else { $folder = $this->getFolderByDisplayName($displayName, 'calendar'); } @@ -38,7 +37,7 @@ public function pickCalendar($displayName='default.calendar') public function createCalendarItems($items) { //If the item passed in is an object, or if it's an assosiative array waiting to be an object, let's put it in to an array - if(!is_array($items) || Type::arrayIsAssoc($items)) { + if (!is_array($items) || Type::arrayIsAssoc($items)) { $items = array($items); } @@ -113,6 +112,6 @@ public function getCalendarItems($start = '12:00 AM', $end = '11:59 PM', $option */ public function listChanges($syncState = null, $options = array()) { - return parent::listChanges($this->_folderId->Id, $syncState, $options); + return parent::listItemChanges($this->_folderId->Id, $syncState, $options); } }