From 055aadec5d5c77e397a0145a3b8e8d33827cc7a3 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 24 Mar 2017 22:44:58 -0500 Subject: [PATCH] Minor - Improve PHPDoc --- main/inc/lib/extra_field_value.lib.php | 4 ++- main/inc/lib/groupmanager.lib.php | 28 +++++++++++------ main/inc/lib/sessionmanager.lib.php | 8 ++--- main/inc/lib/social.lib.php | 14 ++++----- main/lp/learnpath.class.php | 2 +- main/webservices/cm_webservice.php | 30 +++++++++---------- main/work/work.lib.php | 9 +++--- .../CoreBundle/Component/Editor/Finder.php | 2 +- 8 files changed, 54 insertions(+), 43 deletions(-) diff --git a/main/inc/lib/extra_field_value.lib.php b/main/inc/lib/extra_field_value.lib.php index 2e5c69e455..277e855d37 100755 --- a/main/inc/lib/extra_field_value.lib.php +++ b/main/inc/lib/extra_field_value.lib.php @@ -622,7 +622,8 @@ class ExtraFieldValue extends Model * @param int $item_id Item ID from the original table * @param string $field_variable The name of the field we are looking for * @param bool $transform - * @param bool $allVisibility + * @param bool $filterByVisibility + * @param int $visibility * * @return mixed Array of results, or false on error or not found * @assert (-1,'') === false @@ -730,6 +731,7 @@ class ExtraFieldValue extends Model } /** + * Get all the values stored for one specific field * @param int $fieldId * * @return array|bool diff --git a/main/inc/lib/groupmanager.lib.php b/main/inc/lib/groupmanager.lib.php index 4ca6d789e4..121710b49c 100755 --- a/main/inc/lib/groupmanager.lib.php +++ b/main/inc/lib/groupmanager.lib.php @@ -784,10 +784,18 @@ class GroupManager * Create group category * @param string $title The title of the new category * @param string $description The description of the new category - * @param bool $self_registration_allowed - * @param bool $self_unregistration_allowed - * @param int $max_number_of_students + * @param int $doc_state + * @param int $work_state + * @param int $calendar_state + * @param int $announcements_state + * @param int $forum_state + * @param int $wiki_state + * @param int $chat_state + * @param int $self_registration_allowed + * @param int $self_unregistration_allowed + * @param int $maximum_number_of_students * @param int $groups_per_user + * @return mixed */ public static function create_category( $title, @@ -1776,10 +1784,9 @@ class GroupManager /** * Get all group's from a given course in which a given user is unsubscribed * @author Patrick Cool - * @param int course id - * retrieve the groups for - * @param integer $user_id: the ID of the user you want to know all its - * group memberships + * @param int $course_id retrieve the groups for + * @param int $user_id the ID of the user you want to know all its group memberships + * @return array */ public static function get_group_ids($course_id, $user_id) { @@ -1819,8 +1826,9 @@ class GroupManager * Filter out duplicates in a multidimensional array * by comparing field $compare_field. * - * @param $user_array_in list of users (must be sorted). - * @param string $compare_field, the field to be compared + * @param array $user_array_in List of users (must be sorted). + * @param string $compare_field The field to be compared + * @return array */ public static function filter_duplicates($user_array_in, $compare_field) { @@ -1839,6 +1847,8 @@ class GroupManager /** * Remove all users that are not students and all users who have tutor status * from the list. + * @param array $user_array_in + * @return array */ public static function filter_only_students($user_array_in) { diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index cd987edee6..cc99bad368 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -2602,7 +2602,7 @@ class SessionManager * @param integer year_end * @param integer month_end * @param integer day_end - * @return $id_session; + * @return int session ID * */ public static function create_category_session( $sname, @@ -2668,7 +2668,7 @@ class SessionManager } /** - * Edit a sessions categories + * Edit a sessions category * @author Jhon Hinojosa ,from existing code * @param integer id * @param string name @@ -2678,7 +2678,7 @@ class SessionManager * @param integer year_end * @param integer month_end * @param integer day_end - * @return $id; + * @return bool * The parameter id is a primary key * */ public static function edit_category_session( @@ -5672,7 +5672,7 @@ class SessionManager * @param string $lastConnectionDate * @param array $sessionIdList * @param array $studentIdList - * @param int $userStatus STUDENT|COURSEMANAGER constants + * @param int $filterUserStatus STUDENT|COURSEMANAGER constants * * @return array|int */ diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index b91eedee90..7a148c0013 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -386,8 +386,7 @@ class SocialManager extends UserManager * Get invitation list sent by user * @author Julio Montoya * @param int $userId - * - * @return array() + * @return array */ public static function get_list_invitation_sent_by_user_id($userId) { @@ -491,11 +490,12 @@ class SocialManager extends UserManager } /** - * allow attach to group - * @author isaac flores paz - * @param int user to qualify - * @param int kind of rating - * @return void() + * Allow attaching to group + * @author Isaac Flores Paz + * @param int $id_friend_qualify User to qualify + * @param int $type_qualify Kind of rating + * @return void + * @deprecated 2017-03 */ public static function qualify_friend($id_friend_qualify, $type_qualify) { diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 8bd6eeb11d..934b5be2f6 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -4307,7 +4307,7 @@ class learnpath /** * Saves the given item - * @param integer $item_id. Optional (will take from $_REQUEST if null) + * @param integer $item_id Optional (will take from $_REQUEST if null) * @param boolean $from_outside Save from url params (true) or from current attributes (false). Optional. Defaults to true * @return boolean */ diff --git a/main/webservices/cm_webservice.php b/main/webservices/cm_webservice.php index 9926edea9c..22b1d371e4 100755 --- a/main/webservices/cm_webservice.php +++ b/main/webservices/cm_webservice.php @@ -47,7 +47,7 @@ class WSCMError /** * Sets the error handler * - * @param WSErrorHandler Error handler + * @param WSErrorHandler $handler Error handler */ public static function setErrorHandler($handler) { @@ -85,7 +85,7 @@ interface WSCMErrorHandler /** * Handle method * - * @param WSError Error + * @param WSError $error Error */ public function handle($error); } @@ -113,7 +113,7 @@ class WSCM /** * Verifies the API key * - * @param string Secret key + * @param string $secret_key Secret key * @return mixed WSError in case of failure, null in case of success */ protected function verifyKey($secret_key) @@ -137,10 +137,10 @@ class WSCM /** * Verifies if the user is valid * - * @param $username of the user in chamilo - * @param $pass of the same user (in MD5 of SHA) + * @param string $username of the user in chamilo + * @param string $pass of the same user (in MD5 of SHA) * - * return "valid" if username e password are correct! Else, return a message error + * @return mixed "valid" if username e password are correct! Else, return a message error */ public function verifyUserPass($username, $pass) { @@ -185,8 +185,8 @@ class WSCM * Note that if the user id field name is "chamilo_user_id", it will use the user id * in the system database * - * @param string User id field name - * @param string User id value + * @param string $user_id_field_name User id field name + * @param string $user_id_value User id value * @return mixed System user id if the user was found, WSError otherwise */ protected function getUserId($user_id_field_name, $user_id_value) @@ -215,8 +215,8 @@ class WSCM * Note that if the course id field name is "chamilo_course_id", it will use the course id * in the system database * - * @param string Course id field name - * @param string Course id value + * @param string $course_id_field_name Course id field name + * @param string $course_id_value Course id value * @return mixed System course id if the course was found, WSError otherwise */ protected function getCourseId($course_id_field_name, $course_id_value) @@ -245,8 +245,8 @@ class WSCM * Note that if the session id field name is "chamilo_session_id", it will use the session id * in the system database * - * @param string Session id field name - * @param string Session id value + * @param string $session_id_field_name Session id field name + * @param string $session_id_value Session id value * @return mixed System session id if the session was found, WSError otherwise */ protected function getSessionId($session_id_field_name, $session_id_value) @@ -274,7 +274,7 @@ class WSCM /** * Handles an error by calling the WSError error handler * - * @param WSError Error + * @param WSError $error Error */ protected function handleError($error) { @@ -304,8 +304,8 @@ class WSCM /** * *Strictly* reverts PHP's nl2br() effects (whether it was used in XHTML mode or not) - * @param $string - * @return $string + * @param string $string + * @return string */ public function nl2br_revert($string) { diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 4de24857fe..cff2f09705 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -866,7 +866,7 @@ function get_work_path($id) * @param string $new_path Destination directory where the work has been moved (must end with a '/') * @param int $parent_id * - * @return -1 on error, sql query result on success + * @return mixed Int -1 on error, sql query result on success */ function updateWorkUrl($id, $new_path, $parent_id) { @@ -985,13 +985,13 @@ function directory_to_array($directory) return $array_items; } + /** * Insert into the DB of the course all the directories - * @param string path of the /work directory of the course - * @return -1 on error, sql query result on success + * @param string $base_work_dir path of the /work directory of the course + * @return mixed Int -1 on error, sql query result on success * @author Julio Montoya * @version April 2008 - * @param string $base_work_dir */ function insert_all_directory_in_course_table($base_work_dir) @@ -1029,7 +1029,6 @@ function insert_all_directory_in_course_table($base_work_dir) Database::insert($work_table, $params); } } - /** * This function displays the number of files contained in a directory * diff --git a/src/Chamilo/CoreBundle/Component/Editor/Finder.php b/src/Chamilo/CoreBundle/Component/Editor/Finder.php index 1a85ed0edd..0fc73fb97c 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/Finder.php +++ b/src/Chamilo/CoreBundle/Component/Editor/Finder.php @@ -26,7 +26,7 @@ class Finder extends \elFinder /** * Constructor * - * @param array elFinder and roots configurations + * @param array $opts elFinder and roots configurations * @author Dmitry (dio) Levashov */ public function __construct($opts)