mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-77599 coding-style: Replace forbidden @const tags by @var
@const is not a valid phpdoc tag and @var should be used to document both classes properties and constants (no matter how weird that may sound, heh). Link to (draft right now) PHP-FIG: https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#518-var So, with this commit we are just replacing all uses by the correct @var one. Note that the type is entirely optional, in fact I think that there isn't much need of it for constants because it's obvious for both humans and machines which the type is. But, as far as it's also correct to specify it, we haven't modified that detail. The only detail modified are the cases where the constant name was specified in the phpdoc, that's not needed, hence, the names have been removed from there when present (a couple of cases).
This commit is contained in:
parent
8dbb6183ff
commit
d9f7fe9c3f
@ -469,7 +469,7 @@ class tool_customlang_menu implements renderable {
|
||||
*/
|
||||
class tool_customlang_translator implements renderable {
|
||||
|
||||
/** @const int number of rows per page */
|
||||
/** @var int number of rows per page */
|
||||
const PERPAGE = 100;
|
||||
|
||||
/** @var int total number of the rows int the table */
|
||||
|
@ -36,7 +36,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
class subscription_manager {
|
||||
|
||||
/** @const Period of time, in days, after which an inactive subscription will be removed completely.*/
|
||||
/** @var Period of time, in days, after which an inactive subscription will be removed completely.*/
|
||||
const INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS = 30;
|
||||
|
||||
/**
|
||||
|
@ -2195,9 +2195,9 @@ class admin_setting_flag {
|
||||
private $shortname = '';
|
||||
/** @var string String used as the label for this flag */
|
||||
private $displayname = '';
|
||||
/** @const Checkbox for this flag is displayed in admin page */
|
||||
/** @var Checkbox for this flag is displayed in admin page */
|
||||
const ENABLED = true;
|
||||
/** @const Checkbox for this flag is not displayed in admin page */
|
||||
/** @var Checkbox for this flag is not displayed in admin page */
|
||||
const DISABLED = false;
|
||||
|
||||
/**
|
||||
|
@ -34,19 +34,19 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_collator {
|
||||
/** @const compare items using general PHP comparison, equivalent to Collator::SORT_REGULAR, this may bot be locale aware! */
|
||||
/** @var compare items using general PHP comparison, equivalent to Collator::SORT_REGULAR, this may bot be locale aware! */
|
||||
const SORT_REGULAR = 0;
|
||||
|
||||
/** @const compare items as strings, equivalent to Collator::SORT_STRING */
|
||||
/** @var compare items as strings, equivalent to Collator::SORT_STRING */
|
||||
const SORT_STRING = 1;
|
||||
|
||||
/** @const compare items as numbers, equivalent to Collator::SORT_NUMERIC */
|
||||
/** @var compare items as numbers, equivalent to Collator::SORT_NUMERIC */
|
||||
const SORT_NUMERIC = 2;
|
||||
|
||||
/** @const compare items like natsort(), equivalent to SORT_NATURAL */
|
||||
/** @var compare items like natsort(), equivalent to SORT_NATURAL */
|
||||
const SORT_NATURAL = 6;
|
||||
|
||||
/** @const do not ignore case when sorting, use bitwise "|" with SORT_NATURAL or SORT_STRING, equivalent to Collator::UPPER_FIRST */
|
||||
/** @var do not ignore case when sorting, use bitwise "|" with SORT_NATURAL or SORT_STRING, equivalent to Collator::UPPER_FIRST */
|
||||
const CASE_SENSITIVE = 64;
|
||||
|
||||
/** @var Collator|false|null **/
|
||||
|
@ -45,11 +45,11 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
abstract class icon_system {
|
||||
/**
|
||||
* @const STANDARD Default icon system.
|
||||
* @var Default icon system.
|
||||
*/
|
||||
const STANDARD = '\\core\\output\\icon_system_standard';
|
||||
/**
|
||||
* @const FONTAWESOME Default icon system.
|
||||
* @var Default icon system.
|
||||
*/
|
||||
const FONTAWESOME = '\\core\\output\\icon_system_fontawesome';
|
||||
|
||||
|
@ -53,23 +53,23 @@ class xmldb_field extends xmldb_object {
|
||||
* - MySQL: VARCHAR 65,535 chars
|
||||
* - PostgreSQL: no limit
|
||||
*
|
||||
* @const maximum length of text field
|
||||
* @var maximum length of text field
|
||||
*/
|
||||
const CHAR_MAX_LENGTH = 1333;
|
||||
|
||||
|
||||
/**
|
||||
* @const maximum number of digits of integers
|
||||
* @var maximum number of digits of integers
|
||||
*/
|
||||
const INTEGER_MAX_LENGTH = 20;
|
||||
|
||||
/**
|
||||
* @const max length (precision, the total number of digits) of decimals
|
||||
* @var max length (precision, the total number of digits) of decimals
|
||||
*/
|
||||
const NUMBER_MAX_LENGTH = 38;
|
||||
|
||||
/**
|
||||
* @const max length of floats
|
||||
* @var max length of floats
|
||||
*/
|
||||
const FLOAT_MAX_LENGTH = 20;
|
||||
|
||||
@ -77,7 +77,7 @@ class xmldb_field extends xmldb_object {
|
||||
* Note:
|
||||
* - Oracle has 30 chars limit for all names
|
||||
*
|
||||
* @const maximumn length of field names
|
||||
* @var maximumn length of field names
|
||||
*/
|
||||
const NAME_MAX_LENGTH = 30;
|
||||
|
||||
|
@ -41,7 +41,7 @@ class xmldb_index extends xmldb_object {
|
||||
* Note:
|
||||
* - MySQL: MyISAM has a limit of 1000 bytes for any key including composed, InnoDB has limit 3500 bytes.
|
||||
*
|
||||
* @const max length of composed indexes, one utf-8 char is 3 bytes in the worst case
|
||||
* @var max length of composed indexes, one utf-8 char is 3 bytes in the worst case
|
||||
*/
|
||||
const INDEX_COMPOSED_MAX_BYTES = 999;
|
||||
|
||||
@ -49,7 +49,7 @@ class xmldb_index extends xmldb_object {
|
||||
* Note:
|
||||
* - MySQL: InnoDB limits size of index on single column to 767bytes (256 chars)
|
||||
*
|
||||
* @const single column index length limit, one utf-8 char is 3 bytes in the worst case
|
||||
* @var single column index length limit, one utf-8 char is 3 bytes in the worst case
|
||||
*/
|
||||
const INDEX_MAX_BYTES = 765;
|
||||
|
||||
|
@ -42,7 +42,7 @@ class xmldb_table extends xmldb_object {
|
||||
* - Oracle has 30 chars limit for all names,
|
||||
* 2 chars are reserved for prefix.
|
||||
*
|
||||
* @const maximum length of field names
|
||||
* @var maximum length of field names
|
||||
*/
|
||||
const NAME_MAX_LENGTH = 28;
|
||||
|
||||
|
@ -34,21 +34,21 @@ require_once(__DIR__ . '/fixtures/testable_assign.php');
|
||||
*/
|
||||
class base_test extends \advanced_testcase {
|
||||
|
||||
/** @const Default number of students to create */
|
||||
/** @var Default number of students to create */
|
||||
const DEFAULT_STUDENT_COUNT = 3;
|
||||
/** @const Default number of teachers to create */
|
||||
/** @var Default number of teachers to create */
|
||||
const DEFAULT_TEACHER_COUNT = 2;
|
||||
/** @const Default number of editing teachers to create */
|
||||
/** @var Default number of editing teachers to create */
|
||||
const DEFAULT_EDITING_TEACHER_COUNT = 2;
|
||||
/** @const Optional extra number of students to create */
|
||||
/** @var Optional extra number of students to create */
|
||||
const EXTRA_STUDENT_COUNT = 40;
|
||||
/** @const Optional number of suspended students */
|
||||
/** @var Optional number of suspended students */
|
||||
const EXTRA_SUSPENDED_COUNT = 10;
|
||||
/** @const Optional extra number of teachers to create */
|
||||
/** @var Optional extra number of teachers to create */
|
||||
const EXTRA_TEACHER_COUNT = 5;
|
||||
/** @const Optional extra number of editing teachers to create */
|
||||
/** @var Optional extra number of editing teachers to create */
|
||||
const EXTRA_EDITING_TEACHER_COUNT = 5;
|
||||
/** @const Number of groups to create */
|
||||
/** @var Number of groups to create */
|
||||
const GROUP_COUNT = 6;
|
||||
|
||||
/** @var \stdClass $course New course created to hold the assignments */
|
||||
|
@ -81,10 +81,10 @@ function workshopform_accumulative_pluginfile($course, $cm, $context, $filearea,
|
||||
*/
|
||||
class workshop_accumulative_strategy implements workshop_strategy {
|
||||
|
||||
/** @const default number of dimensions to show */
|
||||
/** @var default number of dimensions to show */
|
||||
const MINDIMS = 3;
|
||||
|
||||
/** @const number of dimensions to add */
|
||||
/** @var number of dimensions to add */
|
||||
const ADDDIMS = 2;
|
||||
|
||||
/** @var workshop the parent workshop instance */
|
||||
|
@ -81,10 +81,10 @@ function workshopform_comments_pluginfile($course, $cm, $context, $filearea, arr
|
||||
*/
|
||||
class workshop_comments_strategy implements workshop_strategy {
|
||||
|
||||
/** @const default number of dimensions to show */
|
||||
/** @var default number of dimensions to show */
|
||||
const MINDIMS = 3;
|
||||
|
||||
/** @const number of dimensions to add */
|
||||
/** @var number of dimensions to add */
|
||||
const ADDDIMS = 2;
|
||||
|
||||
/** @var workshop the parent workshop instance */
|
||||
|
@ -81,10 +81,10 @@ function workshopform_numerrors_pluginfile($course, $cm, $context, $filearea, ar
|
||||
*/
|
||||
class workshop_numerrors_strategy implements workshop_strategy {
|
||||
|
||||
/** @const default number of dimensions to show */
|
||||
/** @var default number of dimensions to show */
|
||||
const MINDIMS = 3;
|
||||
|
||||
/** @const number of dimensions to add */
|
||||
/** @var number of dimensions to add */
|
||||
const ADDDIMS = 2;
|
||||
|
||||
/** @var workshop the parent workshop instance */
|
||||
|
@ -81,10 +81,10 @@ function workshopform_rubric_pluginfile($course, $cm, $context, $filearea, array
|
||||
*/
|
||||
class workshop_rubric_strategy implements workshop_strategy {
|
||||
|
||||
/** @const default number of dimensions to show */
|
||||
/** @var default number of dimensions to show */
|
||||
const MINDIMS = 3;
|
||||
|
||||
/** @const number of dimensions to add */
|
||||
/** @var number of dimensions to add */
|
||||
const ADDDIMS = 2;
|
||||
|
||||
/** @var workshop the parent workshop instance */
|
||||
|
@ -39,17 +39,17 @@ require_once($CFG->dirroot . '/question/type/numerical/question.php');
|
||||
*/
|
||||
class qtype_calculated extends question_type {
|
||||
/**
|
||||
* @const string a placeholder is a letter, followed by almost any characters. (This should probably be restricted more.)
|
||||
* @var string a placeholder is a letter, followed by almost any characters. (This should probably be restricted more.)
|
||||
*/
|
||||
const PLACEHOLDER_REGEX_PART = '[[:alpha:]][^>} <`{"\']*';
|
||||
|
||||
/**
|
||||
* @const string REGEXP for a placeholder, wrapped in its {...} delimiters, with capturing brackets around the name.
|
||||
* @var string REGEXP for a placeholder, wrapped in its {...} delimiters, with capturing brackets around the name.
|
||||
*/
|
||||
const PLACEHODLER_REGEX = '~\{(' . self::PLACEHOLDER_REGEX_PART . ')\}~';
|
||||
|
||||
/**
|
||||
* @const string Regular expression that finds the formulas in content, with capturing brackets to get the forumlas.
|
||||
* @var string Regular expression that finds the formulas in content, with capturing brackets to get the forumlas.
|
||||
*/
|
||||
const FORMULAS_IN_TEXT_REGEX = '~\{=([^{}]*(?:\{' . self::PLACEHOLDER_REGEX_PART . '\}[^{}]*)*)\}~';
|
||||
|
||||
|
@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die;
|
||||
*/
|
||||
class report_loglive_renderable implements renderable {
|
||||
|
||||
/** @const int number of seconds to show logs from, by default. */
|
||||
/** @var int number of seconds to show logs from, by default. */
|
||||
const CUTOFF = 3600;
|
||||
|
||||
/** @var \core\log\manager log manager */
|
||||
|
Loading…
x
Reference in New Issue
Block a user