Bläddra i källkod

Minor - PHPDoc updates as suggested by @scrutinizer-auto-fixer

Yannick Warnier 7 år sedan
förälder
incheckning
46f335d40b

+ 1 - 1
main/forum/forumfunction.inc.php

@@ -2588,7 +2588,7 @@ function store_thread(
         )
         ->setThreadQualifyMax(isset($values['numeric_calification']) ? (int) $values['numeric_calification'] : 0)
         ->setThreadWeight(isset($values['weight_calification']) ? (int) $values['weight_calification'] : 0)
-        ->setThreadPeerQualify(isset($values['thread_peer_qualify']) ? (int) $values['thread_peer_qualify'] : 0)
+        ->setThreadPeerQualify(isset($values['thread_peer_qualify']) ? (bool) $values['thread_peer_qualify'] : false)
         ->setSessionId($sessionId)
         ->setLpItemId(isset($values['lp_item_id']) ? (int) $values['lp_item_id'] : 0)
         ->setThreadId(0)

+ 3 - 3
main/inc/lib/usermanager.lib.php

@@ -1817,7 +1817,7 @@ class UserManager
      * @see     UserManager::delete_user_picture() as the prefered way for deletion.
      * @param   string $source_file The full system name of the image from which user photos will be created.
      * @param   string $cropParameters Optional string that contents "x,y,width,height" of a cropped image format
-     * @return  string/bool Returns the resulting common file name of created images which usually should be stored in database.
+     * @return  mixed Returns the resulting common file name of created images which usually should be stored in database.
      * When deletion is requested returns empty string. In case of internal error or negative validation returns FALSE.
      */
     public static function update_user_picture($user_id, $file = null, $source_file = null, $cropParameters = '')
@@ -1967,8 +1967,8 @@ class UserManager
     /**
      * Deletes user photos.
      * Note: This method relies on configuration setting from main/inc/conf/profile.conf.php
-     * @param int $user_id            The user internal identitfication number.
-     * @return string/bool            Returns empty string on success, FALSE on error.
+     * @param int $user_id            The user internal identification number.
+     * @return mixed            Returns empty string on success, FALSE on error.
      */
     public static function delete_user_picture($user_id)
     {

+ 5 - 3
main/lp/learnpath.class.php

@@ -57,7 +57,7 @@ class learnpath
     public $progress_bar_mode = '%';
 
     // Percentage progress as saved in the db.
-    public $progress_db = '0';
+    public $progress_db = 0;
     public $proximity; // Wether the content is distant or local or unknown.
     public $refs_list = array(); //list of items by ref => db_id. Used only for prerequisites match.
     // !!!This array (refs_list) is built differently depending on the nature of the LP.
@@ -395,6 +395,7 @@ class learnpath
                     }
                 }
 
+
                 $this->ordered_items = self::get_flat_ordered_items_list(
                     $this->get_id(),
                     0,
@@ -2185,6 +2186,7 @@ class learnpath
     /**
      * Gets the progress value from the progress_db attribute
      * @return	integer	Current progress value
+     * @deprecated This method does not seem to be used as of 20170514
      */
     public function get_progress()
     {
@@ -3068,7 +3070,7 @@ class learnpath
      * This method can be used as abstract and is recursive
      * @param	integer	Learnpath ID
      * @param	integer	Parent ID of the items to look for
-     * @return	mixed	Ordered list of item IDs or false on error
+     * @return	array	Ordered list of item IDs (empty array on error)
      */
     public static function get_flat_ordered_items_list($lp, $parent = 0, $course_id = null)
     {
@@ -3080,7 +3082,7 @@ class learnpath
         $list = array();
 
         if (empty($lp)) {
-            return false;
+            return $list;
         }
 
         $lp = intval($lp);

+ 4 - 2
main/lp/openoffice_text_document.class.php

@@ -136,6 +136,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
         }
 
         $i = 0;
+        $previous = 0; // @todo define this variable properly
         foreach ($items_to_create as $item_title => $item_content) {
             $i++;
             $page_content = $this->format_page_content($header, $item_content);
@@ -175,7 +176,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
                 $slide_name = api_html_entity_decode($slide_name, ENT_COMPAT, api_get_system_encoding());
                 $previous = learnpath::add_item(0, $previous, 'document', $document_id, $slide_name, '');
                 if ($this->first_item == 0) {
-                    $this->first_item = $previous;
+                    $this->first_item = (int) $previous;
                 }
             }
         }
@@ -215,6 +216,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
             );
 
             $slide_name = '';
+            $previous = 0; // @todo define this variable properly
             if ($document_id) {
                 // Put the document in item_property update.
                 api_item_property_update(
@@ -234,7 +236,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
                 $slide_name = 'Page '.str_repeat('0', 2 - strlen($key)).$key;
                 $previous = learnpath::add_item(0, $previous, 'document', $document_id, $slide_name, '');
                 if ($this->first_item == 0) {
-                    $this->first_item = $previous;
+                    $this->first_item = (int) $previous;
                 }
                 // Code for text indexing.
                 if (isset($_POST['index_document']) && $_POST['index_document']) {

+ 3 - 5
main/survey/surveyUtil.class.php

@@ -3010,8 +3010,7 @@ class SurveyUtil
      * Creates a multi array with the user fields that we can show. We look the visibility with the api_get_setting function
      * The username is always NOT able to change it.
      * @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification
-     * @return array[value_name][name]
-     * 		   array[value_name][visibilty]
+     * @return array  array[value_name][name], array[value_name][visibilty]
      */
     public static function make_field_list()
     {
@@ -3155,10 +3154,9 @@ class SurveyUtil
 
     /**
      * @author Isaac Flores Paz <florespaz@bidsoftperu.com>
-     * @param int $user_id - User ID
+     * @param int $user_id User ID
      * @param string $survey_code
-     * @param int $user_id_answer - User in survey answer table (user id or anonymus)
-     *
+     * @param int $user_answer User in survey answer table (user id or anonymous)
      * @return boolean
      */
     public static function show_link_available($user_id, $survey_code, $user_answer)

+ 2 - 2
src/Chamilo/CoreBundle/Component/Editor/Connector.php

@@ -17,10 +17,10 @@ use Symfony\Component\Translation\Translator;
  */
 class Connector
 {
-    /** @var Course */
+    /** @var array */
     public $course;
 
-    /** @var User */
+    /** @var array */
     public $user;
 
     /** @var Translator */

+ 2 - 2
src/Chamilo/CourseBundle/Entity/CForumThread.php

@@ -166,7 +166,7 @@ class CForumThread
      */
     public function __construct()
     {
-        $this->threadPeerQualify = 0;
+        $this->threadPeerQualify = false;
         $this->threadReplies = 0;
         $this->threadViews = 0;
     }
@@ -181,7 +181,7 @@ class CForumThread
 
     /**
      * set threadPeerQualify
-     * @param integer $threadPeerQualify
+     * @param bool $threadPeerQualify
      * @return $this
      */
     public function setThreadPeerQualify($threadPeerQualify)

+ 2 - 2
src/Chamilo/PageBundle/Entity/User.php

@@ -129,7 +129,7 @@ class User extends BaseUser
     private $authSource;
 
     /**
-     * @var boolean
+     * @var integer
      *
      * @ORM\Column(name="status", type="integer", nullable=false)
      */
@@ -234,7 +234,7 @@ class User extends BaseUser
     private $expirationDate;
 
     /**
-     * @var boolean
+     * @var int
      *
      * @ORM\Column(name="active", type="boolean", nullable=false, unique=false)
      */