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

pull/2487/head
Yannick Warnier 8 years ago
parent 46f335d40b
commit e73ca6ec6a
  1. 9
      main/gradebook/lib/be/surveylink.class.php
  2. 2
      main/inc/lib/TicketManager.php
  3. 12
      main/inc/lib/document.lib.php
  4. 4
      main/inc/lib/events.lib.php
  5. 2
      main/inc/lib/fileUpload.lib.php
  6. 2
      main/inc/lib/myspace.lib.php
  7. 3
      main/inc/lib/search/xapian/XapianIndexer.class.php
  8. 2
      main/inc/lib/text.lib.php
  9. 2
      main/inc/lib/usergroup.lib.php
  10. 2
      main/install/install.lib.php
  11. 4
      main/lp/learnpathList.class.php
  12. 2
      main/lp/openoffice_presentation.class.php
  13. 2
      plugin/openmeetings/lib/openmeetings.class.php
  14. 28
      plugin/vchamilo/cli/clilib.php
  15. 4
      src/Chamilo/CoreBundle/Entity/Course.php
  16. 2
      src/Chamilo/CoreBundle/Entity/GradebookScoreLog.php
  17. 4
      src/Chamilo/CoreBundle/Entity/SequenceResource.php
  18. 4
      src/Chamilo/CoreBundle/Entity/Session.php
  19. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php
  20. 2
      src/Chamilo/CourseBundle/Entity/CLp.php
  21. 2
      src/Chamilo/CourseBundle/Entity/CLpItem.php
  22. 12
      src/Chamilo/CourseBundle/Entity/CQuizAnswer.php
  23. 2
      src/Chamilo/CourseBundle/Entity/CQuizQuestion.php
  24. 2
      src/Chamilo/CourseBundle/Entity/CToolIntro.php
  25. 2
      src/Chamilo/UserBundle/Entity/User.php

@ -277,7 +277,8 @@ class SurveyLink extends AbstractLink
} }
/** /**
* @return array|bool|mixed * Get the survey data from the c_survey table with the current object id
* @return mixed
*/ */
private function get_survey_data() private function get_survey_data()
{ {
@ -291,13 +292,17 @@ class SurveyLink extends AbstractLink
WHERE WHERE
c_id = '.$this->course_id.' AND c_id = '.$this->course_id.' AND
survey_id = '.intval($this->get_ref_id()).' AND survey_id = '.intval($this->get_ref_id()).' AND
session_id='.intval($session_id); session_id = '.intval($session_id);
$query = Database::query($sql); $query = Database::query($sql);
$this->survey_data = Database::fetch_array($query); $this->survey_data = Database::fetch_array($query);
} }
return $this->survey_data; return $this->survey_data;
} }
/**
* Get the name of the icon for this tool
* @return string
*/
public function get_icon_name() public function get_icon_name()
{ {
return 'survey'; return 'survey';

@ -1309,8 +1309,8 @@ class TicketManager
} }
/** /**
* Send notification to a user through the internal messaging system
* @param int $ticketId * @param int $ticketId
* @param int $userId
* @param string $title * @param string $title
* @param string $message * @param string $message
* @param int $onlyToUserId * @param int $onlyToUserId

@ -1124,12 +1124,12 @@ class DocumentManager
* This deletes a document by changing visibility to 2, renaming it to filename_DELETED_#id * This deletes a document by changing visibility to 2, renaming it to filename_DELETED_#id
* Files/folders that are inside a deleted folder get visibility 2 * Files/folders that are inside a deleted folder get visibility 2
* *
* @param array $_course * @param array $_course
* @param string $path, path stored in the database * @param string $path Path stored in the database
* @param string $base_work_dir, path to the documents folder (if not defined, $documentId must be used) * @param string $base_work_dir Path to the documents folder (if not defined, $documentId must be used)
* @param int $sessionId The ID of the session, if any * @param int $sessionId The ID of the session, if any
* @param int $documentId The document id, if available * @param int $documentId The document id, if available
* @param int $groupId iid * @param int $groupId iid
* @return boolean true/false * @return boolean true/false
* @todo now only files/folders in a folder get visibility 2, we should rename them too. * @todo now only files/folders in a folder get visibility 2, we should rename them too.
* @todo We should be able to get rid of this later when using only documentId (check further usage) * @todo We should be able to get rid of this later when using only documentId (check further usage)

@ -813,11 +813,11 @@ class Event
/** /**
* Save the new message for one event and for one language * Save the new message for one event and for one language
* *
* @param string $eventName * @param string $event_name
* @param array $users * @param array $users
* @param string $message * @param string $message
* @param string $subject * @param string $subject
* @param string $eventMessageLanguage * @param string $event_message_language
* @param int $activated * @param int $activated
*/ */
public static function save_event_type_message($event_name, $users, $message, $subject, $event_message_language, $activated) public static function save_event_type_message($event_name, $users, $message, $subject, $event_message_language, $activated)

@ -194,7 +194,7 @@ function process_uploaded_file($uploaded_file, $show_output = true)
* @param string $uploadPath Example: /folder1/folder2/ * @param string $uploadPath Example: /folder1/folder2/
* @param int $userId * @param int $userId
* @param int $groupId group.id * @param int $groupId group.id
* @param int $toUserId, NULL for everybody * @param int $toUserId User ID, or NULL for everybody
* @param int $unzip 1/0 * @param int $unzip 1/0
* @param string $whatIfFileExists overwrite, rename or warn if exists (default) * @param string $whatIfFileExists overwrite, rename or warn if exists (default)
* @param boolean $output Optional output parameter. * @param boolean $output Optional output parameter.

@ -1978,7 +1978,7 @@ class MySpace
/** /**
* Checks if there are repeted users in a given array * Checks if there are repeted users in a given array
* @param array $usernames list of the usernames in the uploaded file * @param array $usernames list of the usernames in the uploaded file
* @param array $user_array['username'] and $user_array['sufix'] where sufix is the number part in a login i.e -> jmontoya2 * @param array $user_array $user_array['username'] and $user_array['sufix'] where sufix is the number part in a login i.e -> jmontoya2
* @return array with the $usernames array and the $user_array array * @return array with the $usernames array and the $user_array array
* @author Julio Montoya * @author Julio Montoya
*/ */

@ -286,7 +286,8 @@ abstract class XapianIndexer
* Replace a document in the actual db * Replace a document in the actual db
* *
* @param XapianDocument $doc xapian document to push into the db * @param XapianDocument $doc xapian document to push into the db
* @param Xapian::docid $did xapian document id of the document to replace * @param int $did xapian document id of the document to replace
* @return mixed
*/ */
function replace_document($doc, $did) function replace_document($doc, $did)
{ {

@ -75,8 +75,8 @@ function api_set_encoding_html(&$string, $encoding)
/** /**
* Returns the title of a html document. * Returns the title of a html document.
* @param string $string The contents of the input document. * @param string $string The contents of the input document.
* @param string $output_encoding The encoding of the retrieved title. If the value is not set, the system encoding is assumend.
* @param string $input_encoding The encoding of the input document. If the value is not set, it is detected. * @param string $input_encoding The encoding of the input document. If the value is not set, it is detected.
* @param string $$output_encoding The encoding of the retrieved title. If the value is not set, the system encoding is assumend.
* @return string The retrieved title, html-entities and extra-whitespace between the words are cleaned. * @return string The retrieved title, html-entities and extra-whitespace between the words are cleaned.
*/ */
function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null) function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)

@ -1087,7 +1087,7 @@ class UserGroup extends Model
* If an empty name is provided, then old user photos are deleted only, * If an empty name is provided, then old user photos are deleted only,
* @see UserManager::delete_user_picture() as the prefered way for deletion. * @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 $source_file The full system name of the image from which user photos will be created.
* @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 an image is removed the function returns an empty string. In case of internal error or negative validation it returns FALSE. * When an image is removed the function returns an empty string. In case of internal error or negative validation it returns FALSE.
*/ */
public function update_group_picture($group_id, $file = null, $source_file = null) public function update_group_picture($group_id, $file = null, $source_file = null)

@ -145,7 +145,7 @@ function checkAccessUrl()
* Returns a textual value ('ON' or 'OFF') based on a requester 2-state ini- configuration setting. * Returns a textual value ('ON' or 'OFF') based on a requester 2-state ini- configuration setting.
* *
* @param string $val a php ini value * @param string $val a php ini value
* @return boolean: ON or OFF * @return bool ON or OFF
* @author Joomla <http://www.joomla.org> * @author Joomla <http://www.joomla.org>
*/ */
function getPhpSetting($val) function getPhpSetting($val)

@ -189,8 +189,8 @@ class LearnpathList
); );
$names[$row->getName()] = $row->getIid(); $names[$row->getName()] = $row->getIid();
} }
asort($names);
$this->alpha_list = asort($names); $this->alpha_list = $names;
} }
/** /**

@ -175,7 +175,7 @@ class OpenofficePresentation extends OpenofficeDocument
'' ''
); );
if ($this->first_item == 0) { if ($this->first_item == 0) {
$this->first_item = $previous; $this->first_item = intval($previous);
} }
} }
// Code for text indexing. // Code for text indexing.

@ -178,7 +178,7 @@ class OpenMeetings
//$room->roomtypes_id = $room->roomtypes_id; //$room->roomtypes_id = $room->roomtypes_id;
$room->comment = urlencode(get_lang('Course').': '.$params['meeting_name'].' - '.$_configuration['software_name']); $room->comment = urlencode(get_lang('Course').': '.$params['meeting_name'].' - '.$_configuration['software_name']);
//$room->numberOfPartizipants = $room->numberOfPartizipants; //$room->numberOfPartizipants = $room->numberOfPartizipants;
$room->ispublic = $room->getString('isPublic', 'false'); $room->ispublic = boolval($room->getString('isPublic', 'false'));
//$room->appointment = $room->getString('appointment'); //$room->appointment = $room->getString('appointment');
//$room->isDemoRoom = $room->getString('isDemoRoom'); //$room->isDemoRoom = $room->getString('isDemoRoom');
//$room->demoTime = $room->demoTime; //$room->demoTime = $room->demoTime;

@ -2,17 +2,18 @@
exit; exit;
/** /**
* Opens and parses/checks a VChamilo instance definition file * Opens and parses/checks a VChamilo instance definition file
* @param string $location * @param string $nodelistlocation
* * @param string $plugin
*/ * @return mixed
*/
function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null) { function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null) {
global $_configuration; global $_configuration;
$vnodes = array(); $vnodes = array();
if (empty($nodelistlocation)) { if (empty($nodelistlocation)) {
$nodelistlocation = $_configuratioh['root_sys'].'/plugin/vchamilo/nodelist.csv'; $nodelistlocation = $_configuration['root_sys'].'/plugin/vchamilo/nodelist.csv';
} }
// decode file // decode file
@ -162,9 +163,12 @@ function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null) {
} }
/** /**
* Check a CSV input line format for empty or commented lines * Check a CSV input line format for empty or commented lines
* Ensures compatbility to UTF-8 BOM or unBOM formats * Ensures compatbility to UTF-8 BOM or unBOM formats
*/ * @param resource $text
* @param bool $resetfirst
* @return bool
*/
function vchamilo_is_empty_line_or_format(&$text, $resetfirst = false) { function vchamilo_is_empty_line_or_format(&$text, $resetfirst = false) {
global $CFG; global $CFG;
@ -193,7 +197,7 @@ function vchamilo_is_empty_line_or_format(&$text, $resetfirst = false) {
* @param string $prompt text prompt, should include possible options * @param string $prompt text prompt, should include possible options
* @param string $default default value when enter pressed * @param string $default default value when enter pressed
* @param array $options list of allowed options, empty means any text * @param array $options list of allowed options, empty means any text
* @param bool $casesensitive true if options are case sensitive * @param bool $casesensitiveoptions true if options are case sensitive
* @return string entered text * @return string entered text
*/ */
function cli_input($prompt, $default = '', array $options = null, $casesensitiveoptions = false) { function cli_input($prompt, $default = '', array $options = null, $casesensitiveoptions = false) {
@ -329,11 +333,11 @@ function cli_problem($text) {
* Write to standard out and error with exit in error. * Write to standard out and error with exit in error.
* *
* @param string $text * @param string $text
* @param int $errorcode * @param int $errorCode
* @return void (does not return) * @return void (does not return)
*/ */
function cli_error($text, $errorcode = 1) { function cli_error($text, $errorCode = 1) {
fwrite(STDERR, $text); fwrite(STDERR, $text);
fwrite(STDERR, "\n"); fwrite(STDERR, "\n");
die($errorcode); die($errorCode);
} }

@ -964,7 +964,7 @@ class Course
*/ */
public function setSubscribe($subscribe) public function setSubscribe($subscribe)
{ {
$this->subscribe = intval($subscribe); $this->subscribe = boolval($subscribe);
return $this; return $this;
} }
@ -988,7 +988,7 @@ class Course
*/ */
public function setUnsubscribe($unsubscribe) public function setUnsubscribe($unsubscribe)
{ {
$this->unsubscribe = intval($unsubscribe); $this->unsubscribe = boolval($unsubscribe);
return $this; return $this;
} }

@ -128,7 +128,7 @@ class GradebookScoreLog
/** /**
* Set the achieved score * Set the achieved score
* @param int $score * @param float $score
* *
* @return $this * @return $this
*/ */

@ -66,8 +66,8 @@ class SequenceResource
} }
/** /**
* @param string $type * Set the integer type
* * @param int $type
* @return SequenceResource * @return SequenceResource
*/ */
public function setType($type) public function setType($type)

@ -61,7 +61,7 @@ class Session
private $description; private $description;
/** /**
* @var string * @var bool
* *
* @ORM\Column(name="show_description", type="boolean", nullable=true) * @ORM\Column(name="show_description", type="boolean", nullable=true)
*/ */
@ -232,7 +232,7 @@ class Session
$this->courses = new ArrayCollection(); $this->courses = new ArrayCollection();
$this->users = new ArrayCollection(); $this->users = new ArrayCollection();
$this->userCourseSubscriptions = new ArrayCollection(); $this->userCourseSubscriptions = new ArrayCollection();
$this->showDescription = 0; $this->showDescription = false;
$this->category = null; $this->category = null;
$this->studentPublications = new ArrayCollection(); $this->studentPublications = new ArrayCollection();
} }

@ -2870,7 +2870,7 @@ class CourseRestorer
* @param boolean Option Overwrite * @param boolean Option Overwrite
* @param string $source * @param string $source
* @param string $dest * @param string $dest
* @return void() * @return void
* @deprecated * @deprecated
*/ */
public function allow_create_all_directory($source, $dest, $overwrite = false) public function allow_create_all_directory($source, $dest, $overwrite = false)

@ -275,7 +275,7 @@ class CLp
$this->defaultEncoding = 'UTF-8'; $this->defaultEncoding = 'UTF-8';
$this->displayOrder = 0; $this->displayOrder = 0;
$this->contentLocal = 'local'; $this->contentLocal = 'local';
$this->preventReinit = 1; $this->preventReinit = true;
$this->useMaxScore = 1; $this->useMaxScore = 1;
$this->createdOn = new \DateTime(); $this->createdOn = new \DateTime();
} }

@ -202,7 +202,7 @@ class CLpItem
*/ */
public function __construct() public function __construct()
{ {
$this->maxScore = 100; $this->maxScore = 100.0;
} }
/** /**

@ -125,7 +125,7 @@ class CQuizAnswer
$this->idAuto = 0; $this->idAuto = 0;
$this->correct = null; $this->correct = null;
$this->comment = null; $this->comment = null;
$this->ponderation = 0; $this->ponderation = 0.0;
$this->hotspotCoordinates = null; $this->hotspotCoordinates = null;
$this->hotspotType = null; $this->hotspotType = null;
$this->destination = null; $this->destination = null;
@ -248,20 +248,20 @@ class CQuizAnswer
} }
/** /**
* Set ponderation * Set weight
* *
* @param float $ponderation * @param float $weight
* @return CQuizAnswer * @return CQuizAnswer
*/ */
public function setPonderation($ponderation) public function setPonderation($weight)
{ {
$this->ponderation = empty($ponderation) ? 0 : $ponderation; $this->ponderation = empty($weight) ? 0.0 : $weight;
return $this; return $this;
} }
/** /**
* Get ponderation * Get weight
* *
* @return float * @return float
*/ */

@ -110,7 +110,7 @@ class CQuizQuestion
*/ */
public function __construct() public function __construct()
{ {
$this->ponderation = 0; $this->ponderation = 0.0;
} }
/** /**

@ -81,7 +81,7 @@ class CToolIntro
/** /**
* Set id * Set id
* *
* @param string $id * @param int $id
* @return CToolIntro * @return CToolIntro
*/ */
public function setId($id) public function setId($id)

@ -441,7 +441,7 @@ class User implements UserInterface //implements ParticipantInterface, ThemeUser
{ {
$this->status = self::STUDENT; $this->status = self::STUDENT;
$this->salt = sha1(uniqid(null, true)); $this->salt = sha1(uniqid(null, true));
$this->active = 1; $this->active = true;
$this->registrationDate = new \DateTime(); $this->registrationDate = new \DateTime();
$this->authSource = 'platform'; $this->authSource = 'platform';
$this->courses = new ArrayCollection(); $this->courses = new ArrayCollection();

Loading…
Cancel
Save