diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 502ba924513..1bf7a4eb9db 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -1,5 +1,5 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 84c18d1b220..eae80e428b1 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -120,6 +120,7 @@ class modDebugBar extends DolibarrModules /** * Function called after module configuration. * + * @return void */ public function loadSettings() { diff --git a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php index a39d6189792..15d433fd050 100644 --- a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php @@ -11,6 +11,7 @@ class DolExceptionsCollector extends ExceptionsCollector /** * Return widget settings * + * @return array Array */ public function getWidgets() { @@ -31,4 +32,4 @@ class DolExceptionsCollector extends ExceptionsCollector ) ); } -} \ No newline at end of file +} diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 17653ec8bcc..3653c104c0a 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -76,7 +76,7 @@ class DolLogsCollector extends MessagesCollector /** * Get the path to the logs file * - * @return string + * @return string Path of log file */ public function getLogsFile() { @@ -109,9 +109,9 @@ class DolLogsCollector extends MessagesCollector /** * Get latest file lines * - * @param string $file - * @param int $lines - * @return array + * @param string $file + * @param int $lines + * @return array Array */ protected function tailFile($file, $lines) { @@ -146,8 +146,8 @@ class DolLogsCollector extends MessagesCollector /** * Search a string for log entries * - * @param $file - * @return array + * @param string $file File + * @return array Lines of logs */ public function getLogs($file) { @@ -171,7 +171,7 @@ class DolLogsCollector extends MessagesCollector /** * Get the log levels from psr/log. * - * @return array + * @return array Array of log level */ public function getLevels() { @@ -181,4 +181,4 @@ class DolLogsCollector extends MessagesCollector return $levels; } -} \ No newline at end of file +} diff --git a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php index 5e39c15faf9..ae69b16eba7 100644 --- a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php @@ -2,10 +2,10 @@ use \DebugBar\DataCollector\TimeDataCollector; + /** * DolTimeDataCollector class */ - class DolTimeDataCollector extends TimeDataCollector { /** @@ -32,4 +32,4 @@ class DolTimeDataCollector extends TimeDataCollector ) ); } -} \ No newline at end of file +} diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php index 5ac6d828035..d3cc545e1b3 100644 --- a/htdocs/debugbar/class/DebugBar.php +++ b/htdocs/debugbar/class/DebugBar.php @@ -47,9 +47,10 @@ class DolibarrDebugBar extends DebugBar /** * Returns a JavascriptRenderer for this instance * + * @return string String content */ public function getRenderer() { return parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/DebugBar/Resources'); } -} \ No newline at end of file +} diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index b0f871a97c4..7a18ba6f5cf 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -136,9 +136,9 @@ class TraceableDB extends DoliDB /** * Convert a SQL request in Mysql syntax to native syntax * - * @param string $line SQL request line to convert - * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) - * @return string SQL request line converted + * @param string $line SQL request line to convert + * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) + * @return string SQL request line converted */ public static function convertSQLFromMysql($line, $type = 'ddl') { @@ -148,9 +148,9 @@ class TraceableDB extends DoliDB /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * - * @param resource $resultset Curseur de la requete voulue - * @return int Nombre de lignes - * @see num_rows + * @param resource $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows() */ public function affected_rows($resultset) { @@ -212,14 +212,16 @@ class TraceableDB extends DoliDB return $this->db->decrypt($value); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return datas as an array + * Return datas as an array * - * @param resource $resultset Resultset of request - * @return array Array + * @param resource $resultset Resultset of request + * @return array Array */ public function fetch_array($resultset) { + // phpcs:enable return $this->db->fetch_array($resultset); } @@ -244,6 +246,7 @@ class TraceableDB extends DoliDB return $this->db->escape($stringtoencode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get last ID after an insert INSERT * @@ -253,11 +256,12 @@ class TraceableDB extends DoliDB */ public function last_insert_id($tab, $fieldid = 'rowid') { - return $this->db->last_insert_id($tab, $fieldid); + // phpcs:enable + return $this->db->last_insert_id($tab, $fieldid); } /** - * Return full path of restore program + * Return full path of restore program * * @return string Full path of restore program */ @@ -267,7 +271,7 @@ class TraceableDB extends DoliDB } /** - * Annulation d'une transaction et retour aux anciennes valeurs + * Annulation d'une transaction et retour aux anciennes valeurs * * @param string $log Add more log to default log line * @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur @@ -309,8 +313,8 @@ class TraceableDB extends DoliDB /** * End query tracing * - * @param $sql query string - * @param $resql query result + * @param string $sql query string + * @param string $resql query result */ protected function endTracing($sql, $resql) { @@ -338,7 +342,7 @@ class TraceableDB extends DoliDB * @param string $name name of database (not used for mysql, used for pgsql) * @param int $port Port of database server * @return resource Database access handler - * @see close + * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) { @@ -394,7 +398,7 @@ class TraceableDB extends DoliDB * * @param resource $resultset Resulset of requests * @return int Nb of lines - * @see affected_rows + * @see affected_rows() */ public function num_rows($resultset) { @@ -628,7 +632,7 @@ class TraceableDB extends DoliDB * Close database connexion * * @return boolean True if disconnect successfull, false otherwise - * @see connect + * @see connect() */ public function close() { @@ -655,25 +659,29 @@ class TraceableDB extends DoliDB return $this->db->DDLGetConnectId(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * - * @param resource $resultset Curseur de la requete voulue - * @return Object Object result line or false if KO or end of cursor + * @param resource $resultset Curseur de la requete voulue + * @return Object Object result line or false if KO or end of cursor */ public function fetch_object($resultset) { + // phpcs:enable return $this->db->fetch_object($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Select a database * - * @param string $database Name of database - * @return boolean true if OK, false if KO + * @param string $database Name of database + * @return boolean true if OK, false if KO */ public function select_db($database) { + // phpcs:enable return $this->db->select_db($database); } -} \ No newline at end of file +} diff --git a/htdocs/debugbar/class/actions_debugbar.class.php b/htdocs/debugbar/class/actions_debugbar.class.php index 3678cd2189d..08790ca1cd3 100644 --- a/htdocs/debugbar/class/actions_debugbar.class.php +++ b/htdocs/debugbar/class/actions_debugbar.class.php @@ -9,6 +9,7 @@ class ActionsDebugBar /** * Load Debug bar * + * @return void */ protected function loadDebugBar() { @@ -23,9 +24,9 @@ class ActionsDebugBar /** * Overloading the afterLogin function * - * @param array() $parameters Hook metadatas (context, etc...) - * @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param string &$action Current action (if set). Generally create or edit or null + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null * @param HookManager $hookmanager Hook manager propagated to allow calling another hook * @return int < 0 on error, 0 on success, 1 to replace standard code */ @@ -51,9 +52,9 @@ class ActionsDebugBar /** * Overloading the updateSession function * - * @param array() $parameters Hook metadatas (context, etc...) - * @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param string &$action Current action (if set). Generally create or edit or null + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null * @param HookManager $hookmanager Hook manager propagated to allow calling another hook * @return int < 0 on error, 0 on success, 1 to replace standard code */ @@ -79,11 +80,11 @@ class ActionsDebugBar /** * Overloading the printCommonFooter function * - * @param array() $parameters Hook metadatas (context, etc...) - * @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param string &$action Current action (if set). Generally create or edit or null + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null * @param HookManager $hookmanager Hook manager propagated to allow calling another hook - * @return int < 0 on error, 0 on success, 1 to replace standard code + * @return int <0 on error, 0 on success, 1 to replace standard code */ public function printCommonFooter($parameters, &$object, &$action, $hookmanager) {