aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-05-08 10:27:18 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-08 10:27:18 +0200
commit607f7e725487ce0eb0339b288ce9e58036dad4a0 (patch)
tree5143afbcdcf15e22b70a93e1f4744cc85eea8517 /lib
parent224b20edd16a6abd4879fe0e9e0f4c1608c9accf (diff)
Fix several comments syntaxes (#3615)
Mainly wrong `@return` types in comments
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Configuration.php4
-rw-r--r--lib/Minz/Error.php3
-rw-r--r--lib/Minz/Extension.php5
-rw-r--r--lib/Minz/ExtensionManager.php6
-rw-r--r--lib/Minz/FrontController.php2
-rw-r--r--lib/Minz/Paginator.php24
-rw-r--r--lib/Minz/Request.php10
-rw-r--r--lib/Minz/Session.php2
-rw-r--r--lib/Minz/Translate.php6
-rw-r--r--lib/Minz/Url.php8
-rw-r--r--lib/Minz/View.php2
-rw-r--r--lib/lib_rss.php8
12 files changed, 37 insertions, 43 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php
index 8c9c59802..0e74d4351 100644
--- a/lib/Minz/Configuration.php
+++ b/lib/Minz/Configuration.php
@@ -43,7 +43,7 @@ class Minz_Configuration {
* Return the configuration related to a given namespace.
*
* @param $namespace the name of the configuration to get.
- * @return a Minz_Configuration object
+ * @return Minz_Configuration object
* @throws Minz_ConfigurationNamespaceException if the namespace does not exist.
*/
public static function get($namespace) {
@@ -152,7 +152,7 @@ class Minz_Configuration {
*
* @param $key the name of the param.
* @param $default default value to return if key does not exist.
- * @return the value corresponding to the key.
+ * @return mixed value corresponding to the key.
* @throws Minz_ConfigurationParamException if the param does not exist
*/
public function param($key, $default = null) {
diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php
index 2fb5a4d5d..8f21210aa 100644
--- a/lib/Minz/Error.php
+++ b/lib/Minz/Error.php
@@ -51,8 +51,7 @@ class Minz_Error {
* Permet de retourner les logs de façon à n'avoir que
* ceux que l'on veut réellement
* @param $logs les logs rangés par catégories (error, warning, notice)
- * @return la liste des logs, sans catégorie,
- * > en fonction de l'environment
+ * @return array liste des logs, sans catégorie, en fonction de l'environment
*/
private static function processLogs ($logs) {
$conf = Minz_Configuration::get('system');
diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php
index c97e56355..3bbb3925a 100644
--- a/lib/Minz/Extension.php
+++ b/lib/Minz/Extension.php
@@ -93,8 +93,7 @@ abstract class Minz_Extension {
/**
* Return the content of the configure view for the current extension.
*
- * @return the html content from ext_dir/configure.phtml, false if it does
- * not exist.
+ * @return string html content from ext_dir/configure.phtml, false if it does not exist.
*/
public function getConfigureView() {
$filename = $this->path . '/configure.phtml';
@@ -149,7 +148,7 @@ abstract class Minz_Extension {
* @param $filename name of the file to serve.
* @param $type the type (js or css) of the file to serve.
* @param $isStatic indicates if the file is a static file or a user file. Default is static.
- * @return the url corresponding to the file.
+ * @return string url corresponding to the file.
*/
public function getFileUrl($filename, $type, $isStatic = true) {
if ($isStatic) {
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php
index 0f542894d..eb2d381c4 100644
--- a/lib/Minz/ExtensionManager.php
+++ b/lib/Minz/ExtensionManager.php
@@ -296,7 +296,7 @@ class Minz_ExtensionManager {
*
* @param string $hook_name the hook to call.
* @param additional parameters (for signature, please see self::$hook_list).
- * @return the final result of the called hook.
+ * @return mixed final result of the called hook.
*/
public static function callHook($hook_name) {
if (!isset(self::$hook_list[$hook_name])) {
@@ -326,7 +326,7 @@ class Minz_ExtensionManager {
*
* @param $hook_name is the hook to call.
* @param $arg is the argument to pass to the first extension hook.
- * @return the final chained result of the hooks. If nothing is changed,
+ * @return mixed final chained result of the hooks. If nothing is changed,
* the initial argument is returned.
*/
private static function callOneToOne($hook_name, $arg) {
@@ -350,7 +350,7 @@ class Minz_ExtensionManager {
* returned.
*
* @param string $hook_name is the hook to call.
- * @return a concatenated string, result of the call to all the hooks.
+ * @return string concatenated result of the call to all the hooks.
*/
private static function callNoneToString($hook_name) {
$result = '';
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php
index d6ab756bf..33edf37e3 100644
--- a/lib/Minz/FrontController.php
+++ b/lib/Minz/FrontController.php
@@ -51,7 +51,7 @@ class Minz_FrontController {
/**
* Retourne un tableau représentant l'url passée par la barre d'adresses
- * @return tableau représentant l'url
+ * @return array représentant l'url
*/
private function buildUrl() {
$url = array();
diff --git a/lib/Minz/Paginator.php b/lib/Minz/Paginator.php
index ae506f1ae..7f5f0db8b 100644
--- a/lib/Minz/Paginator.php
+++ b/lib/Minz/Paginator.php
@@ -60,47 +60,43 @@ class Minz_Paginator {
/**
* Permet de retrouver la page d'un élément donné
* @param $item l'élément à retrouver
- * @return la page à laquelle se trouve l'élément (false si non trouvé)
+ * @return float|false la page à laquelle se trouve l’élément, false si non trouvé
*/
public function pageByItem ($item) {
- $page = false;
$i = 0;
do {
if ($item == $this->items[$i]) {
- $page = ceil (($i + 1) / $this->nbItemsPerPage);
+ return ceil(($i + 1) / $this->nbItemsPerPage);
}
-
$i++;
- } while (!$page && $i < $this->nbItems ());
+ } while ($i < $this->nbItems());
- return $page;
+ return false;
}
/**
* Permet de retrouver la position d'un élément donné (à partir de 0)
* @param $item l'élément à retrouver
- * @return la position à laquelle se trouve l'élément (false si non trouvé)
+ * @return float|false la position à laquelle se trouve l’élément, false si non trouvé
*/
public function positionByItem ($item) {
- $find = false;
$i = 0;
do {
if ($item == $this->items[$i]) {
- $find = true;
- } else {
- $i++;
+ return $i;
}
- } while (!$find && $i < $this->nbItems ());
+ $i++;
+ } while ($i < $this->nbItems ());
- return $i;
+ return false;
}
/**
* Permet de récupérer un item par sa position
* @param $pos la position de l'élément
- * @return l'item situé à $pos (dernier item si $pos<0, 1er si $pos>=count($items))
+ * @return mixed item situé à $pos (dernier item si $pos<0, 1er si $pos>=count($items))
*/
public function itemByPosition ($pos) {
if ($pos < 0) {
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index 0c0a0b6a0..614473dd4 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -133,7 +133,7 @@ class Minz_Request {
/**
* Try to guess the base URL from $_SERVER information
*
- * @return the base url (e.g. http://example.com/)
+ * @return string base url (e.g. http://example.com/)
*/
public static function guessBaseUrl() {
$protocol = static::extractProtocol();
@@ -224,7 +224,7 @@ class Minz_Request {
/**
* Return the base_url from configuration and add a suffix if given.
*
- * @return the base_url with a suffix.
+ * @return string base_url with a suffix.
*/
public static function getBaseUrl() {
$conf = Minz_Configuration::get('system');
@@ -239,7 +239,7 @@ class Minz_Request {
* localhost address.
*
* @param $address the address to test, can be an IP or a URL.
- * @return true if server is accessible, false otherwise.
+ * @return boolean true if server is accessible, false otherwise.
* @todo improve test with a more valid technique (e.g. test with an external server?)
*/
public static function serverIsPublic($address) {
@@ -363,7 +363,7 @@ class Minz_Request {
* Permet de récupérer une variable de type $_GET
* @param $param nom de la variable
* @param $default valeur par défaut à attribuer à la variable
- * @return $_GET[$param]
+ * @return string $_GET[$param]
* $_GET si $param = false
* $default si $_GET[$param] n'existe pas
*/
@@ -409,7 +409,7 @@ class Minz_Request {
* Permet de récupérer une variable de type $_POST
* @param $param nom de la variable
* @param $default valeur par défaut à attribuer à la variable
- * @return $_POST[$param]
+ * @return string $_POST[$param]
* $_POST si $param = false
* $default si $_POST[$param] n'existe pas
*/
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php
index f8ecd2f31..0867000e7 100644
--- a/lib/Minz/Session.php
+++ b/lib/Minz/Session.php
@@ -57,7 +57,7 @@ class Minz_Session {
/**
* Permet de récupérer une variable de session
* @param $p le paramètre à récupérer
- * @return la valeur de la variable de session, false si n'existe pas
+ * @return mixed|false la valeur de la variable de session, false si n'existe pas
*/
public static function param($p, $default = false) {
return isset($_SESSION[$p]) ? $_SESSION[$p] : $default;
diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php
index 3a08aba5c..61a52fc52 100644
--- a/lib/Minz/Translate.php
+++ b/lib/Minz/Translate.php
@@ -58,7 +58,7 @@ class Minz_Translate {
/**
* Return the list of available languages.
- * @return an array containing langs found in different registered paths.
+ * @return array containing langs found in different registered paths.
*/
public static function availableLanguages() {
$list_langs = array();
@@ -88,7 +88,7 @@ class Minz_Translate {
* @param $user the connected user language (nullable)
* @param $preferred an array of the preferred languages
* @param $default the preferred language to use
- * @return a string containing the language to use
+ * @return string containing the language to use
*/
public static function getLanguage($user, $preferred, $default) {
if (null !== $user) {
@@ -180,7 +180,7 @@ class Minz_Translate {
* Translate a key into its corresponding value based on selected language.
* @param $key the key to translate.
* @param additional parameters for variable keys.
- * @return the value corresponding to the key.
+ * @return string value corresponding to the key.
* If no value is found, return the key itself.
*/
public static function t($key) {
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 5828d47df..844e5062d 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -12,7 +12,7 @@ class Minz_Url {
* $url['params'] = tableau des paramètres supplémentaires
* ou comme une chaîne de caractère
* @param $encodage pour indiquer comment encoder les & (& ou &amp; pour html)
- * @return l'url formatée
+ * @return string url formatée
*/
public static function display ($url = array (), $encodage = 'html', $absolute = false) {
$isArray = is_array($url);
@@ -57,7 +57,7 @@ class Minz_Url {
* Construit l'URI d'une URL
* @param l'url sous forme de tableau
* @param $encodage pour indiquer comment encoder les & (& ou &amp; pour html)
- * @return l'uri sous la forme ?key=value&key2=value2
+ * @return string uri sous la forme ?key=value&key2=value2
*/
private static function printUri($url, $encodage) {
$uri = '';
@@ -95,8 +95,8 @@ class Minz_Url {
/**
* Vérifie que les éléments du tableau représentant une url soit ok
- * @param l'url sous forme de tableau (sinon renverra directement $url)
- * @return l'url vérifié
+ * @param array|string $url sous forme de tableau (sinon renverra directement $url)
+ * @return string url vérifié
*/
public static function checkUrl ($url) {
$url_checked = $url;
diff --git a/lib/Minz/View.php b/lib/Minz/View.php
index 5b6676690..c208621a4 100644
--- a/lib/Minz/View.php
+++ b/lib/Minz/View.php
@@ -77,7 +77,7 @@ class Minz_View {
* The file is searched inside list of $base_pathnames.
*
* @param $filename the name of the file to include.
- * @return true if the file has been included, false else.
+ * @return boolean true if the file has been included, false else.
*/
private function includeFile($filename) {
// We search the filename in the list of base pathnames. Only the first view
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 0c6191690..3cacc8390 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -19,7 +19,7 @@ if (COPY_SYSLOG_TO_STDERR) {
* Build a directory path by concatenating a list of directory names.
*
* @param $path_parts a list of directory names
- * @return a string corresponding to the final pathname
+ * @return string corresponding to the final pathname
*/
function join_path() {
$path_parts = func_get_args();
@@ -333,7 +333,7 @@ function listUsers() {
*
* Note a max_regstrations of 0 means there is no limit.
*
- * @return true if number of users >= max registrations, false else.
+ * @return boolean true if number of users >= max registrations, false else.
*/
function max_registrations_reached() {
$limit_registrations = FreshRSS_Context::$system_conf->limits['max_registrations'];
@@ -350,7 +350,7 @@ function max_registrations_reached() {
* objects. If you need a long-time configuration, please don't use this function.
*
* @param $username the name of the user of which we want the configuration.
- * @return a Minz_Configuration object, null if the configuration cannot be loaded.
+ * @return Minz_Configuration object, null if the configuration cannot be loaded.
*/
function get_user_configuration($username) {
if (!FreshRSS_user_Controller::checkUsername($username)) {
@@ -499,7 +499,7 @@ function recursive_unlink($dir) {
* Remove queries where $get is appearing.
* @param $get the get attribute which should be removed.
* @param $queries an array of queries.
- * @return the same array whithout those where $get is appearing.
+ * @return array whithout queries where $get is appearing.
*/
function remove_query_by_get($get, $queries) {
$final_queries = array();