From 5a0c2d333ff41ec4da6a4d58bc1553beeee1affa Mon Sep 17 00:00:00 2001 From: rdalverny Date: Sat, 22 Jan 2022 19:53:01 +0100 Subject: More type hints --- app/classes/Planet.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'app/classes/Planet.php') diff --git a/app/classes/Planet.php b/app/classes/Planet.php index 1555c25..0bb4b32 100644 --- a/app/classes/Planet.php +++ b/app/classes/Planet.php @@ -75,13 +75,13 @@ class Planet * @param string $supplied * @return bool */ - public static function authenticateUser(string $known = '', string $supplied = '') + public static function authenticateUser(string $known = '', string $supplied = '') : bool { return hash_equals($known, $supplied); } /** - * @return array $items + * @return array $items */ public function getFeedsItems() { @@ -95,6 +95,8 @@ class Planet /** * Getters + * + * @return array */ public function getItems() { @@ -106,6 +108,9 @@ class Planet return $this->items; } + /** + * @return array + */ public function getPeople() { return $this->people; @@ -115,6 +120,7 @@ class Planet * Adds a feed to the planet. * * @param PlanetFeed $feed + * @return void */ public function addPerson(&$feed) { @@ -150,6 +156,7 @@ class Planet /** * Load feeds + * @return void */ public function loadFeeds() { @@ -168,6 +175,7 @@ class Planet * Fetch feeds and see if new data is present. * * @param float $max_load Percentage of feeds to load + * @return void */ public function download($max_load = 0.1) { @@ -215,6 +223,9 @@ class Planet OpmlManager::save($opml, $this->config->getOpmlFile()); } + /** + * @return void + */ public function sort() { usort($this->items, array('PlanetItem','compare')); @@ -226,13 +237,13 @@ class Planet * * If there's no category, return all items. * - * @param array $items to filter + * @param array $items to filter * @param string $categories to filter against; may be a single word * or a comma-separated list of words. * - * @return array resulting list of items + * @return array resulting list of items */ - public function _filterItemsByCategory($items, $categories = null) + public function _filterItemsByCategory(array $items, string $categories = null) { if (is_null($categories) or empty(trim($categories))) { return $items; -- cgit v1.2.1