Skip to content

Commit

Permalink
Clean up exception handling, phpdoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk authored and yunosh committed Jul 8, 2014
1 parent fbae93b commit 04ba940
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions trean/lib/Tagger.php
Expand Up @@ -21,7 +21,8 @@ class Trean_Tagger extends Horde_Core_Tagger
* - user (array) - only include objects owned by
* these users.
*
* @return A hash of 'bookmark' that contains an array of bookmark ids
* @return array An array of bookmark ids
* @throws Trean_Exception
*/
public function search($tags, $filter = array())
{
Expand All @@ -33,10 +34,13 @@ public function search($tags, $filter = array())
->getTagIds($tags);

$args['typeId'] = $this->_type_ids['bookmark'];
$results = $GLOBALS['injector']
->getInstance('Content_Tagger')
->getObjects($args);

try {
$results = $GLOBALS['injector']
->getInstance('Content_Tagger')
->getObjects($args);
} catch (Content_Exception $e) {
throw new Trean_Exception($e);
}
$results = array_values($results);
return $results;
}
Expand All @@ -45,7 +49,7 @@ public function search($tags, $filter = array())
* Returns tags on bookmarks belonging to the current user.
*
* @return A tag_id => tag_name hash
* @throws Horde_Exception
* @throws Trean_Exception
*/
public function listBookmarkTags()
{
Expand All @@ -56,7 +60,7 @@ public function listBookmarkTags()
'userId' => $GLOBALS['registry']->getAuth())
);
} catch (Content_Exception $e) {
throw new Horde_Exception($e);
throw new Trean_Exception($e);
}
}
}

0 comments on commit 04ba940

Please sign in to comment.