[ticket/16587] Fix phpdoc errors reported by Doctum

PHPBB3-16587
This commit is contained in:
William Desportes 2020-08-29 17:30:11 +02:00
parent 8a8a05e31c
commit fedfc330ef
No known key found for this signature in database
GPG key ID: 90A0EF1B8251A889
13 changed files with 78 additions and 78 deletions

View file

@ -488,8 +488,8 @@ function phpbb_realpath($path)
* Determine which plural form we should use. * Determine which plural form we should use.
* For some languages this is not as simple as for English. * For some languages this is not as simple as for English.
* *
* @param $rule int ID of the plural rule we want to use, see https://area51.phpbb.com/docs/dev/3.3.x/language/plurals.html * @param int $rule ID of the plural rule we want to use, see https://area51.phpbb.com/docs/dev/3.3.x/language/plurals.html
* @param $number int|float The number we want to get the plural case for. Float numbers are floored. * @param int|float $number The number we want to get the plural case for. Float numbers are floored.
* @return int The plural-case we need to use for the number plural-rule combination * @return int The plural-case we need to use for the number plural-rule combination
* *
* @deprecated 3.2.0-dev (To be removed: 4.0.0) * @deprecated 3.2.0-dev (To be removed: 4.0.0)

View file

@ -1610,7 +1610,7 @@ function validate_num($num, $optional = false, $min = 0, $max = 1E99)
/** /**
* Validate Date * Validate Date
* @param String $string a date in the dd-mm-yyyy format * @param string $date_string a date in the dd-mm-yyyy format
* @return boolean * @return boolean
*/ */
function validate_date($date_string, $optional = false) function validate_date($date_string, $optional = false)

View file

@ -20,14 +20,14 @@ class config implements \ArrayAccess, \IteratorAggregate, \Countable
{ {
/** /**
* The configuration data * The configuration data
* @var array(string => string) * @var array<string,string>
*/ */
protected $config; protected $config;
/** /**
* Creates a configuration container with a default set of values * Creates a configuration container with a default set of values
* *
* @param array(string => string) $config The configuration data. * @param array<string,string> $config The configuration data.
*/ */
public function __construct(array $config) public function __construct(array $config)
{ {

View file

@ -818,7 +818,7 @@ class content_visibility
* Add post to topic and forum statistics * Add post to topic and forum statistics
* *
* @param $data array Contains information from the topics table about given topic * @param $data array Contains information from the topics table about given topic
* @param &$sql_data array Populated with the SQL changes, may be empty at call time * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
* @return null * @return null
*/ */
public function add_post_to_statistic($data, &$sql_data) public function add_post_to_statistic($data, &$sql_data)
@ -839,7 +839,7 @@ class content_visibility
* Remove post from topic and forum statistics * Remove post from topic and forum statistics
* *
* @param $data array Contains information from the topics table about given topic * @param $data array Contains information from the topics table about given topic
* @param &$sql_data array Populated with the SQL changes, may be empty at call time * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
* @return null * @return null
*/ */
public function remove_post_from_statistic($data, &$sql_data) public function remove_post_from_statistic($data, &$sql_data)
@ -872,7 +872,7 @@ class content_visibility
* Remove topic from forum statistics * Remove topic from forum statistics
* *
* @param $data array Post and topic data * @param $data array Post and topic data
* @param &$sql_data array Populated with the SQL changes, may be empty at call time * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
* @return null * @return null
*/ */
public function remove_topic_from_statistic($data, &$sql_data) public function remove_topic_from_statistic($data, &$sql_data)

View file

@ -26,7 +26,7 @@ class error_collector
* the error_reporting() function will be used to determine which errors * the error_reporting() function will be used to determine which errors
* the collector will keep. * the collector will keep.
* *
* @see PHPBB3-13306 * @see https://tracker.phpbb.com/browse/PHPBB3-13306
* @param int|null $error_types * @param int|null $error_types
*/ */
function __construct($error_types = null) function __construct($error_types = null)

View file

@ -87,8 +87,8 @@ abstract class attachments_base extends base
/** /**
* Get attachments related to a given post * Get attachments related to a given post
* *
* @param $post_id int Post id * @param int $post_id Post id
* @return mixed Attachments related to $post_id * @return mixed Attachments related to $post_id
*/ */
public function get_attachments($post_id) public function get_attachments($post_id)
{ {

View file

@ -84,7 +84,7 @@ class helper
} }
/** /**
* @param $group_name string The stored group name * @param string $group_name The stored group name
* *
* @return string Group name or translated group name if it exists * @return string Group name or translated group name if it exists
*/ */

View file

@ -194,7 +194,7 @@ class language
} }
/** /**
* @param $key array|string The language key we want to know more about. Can be string or array. * @param array|string $key The language key we want to know more about. Can be string or array.
* *
* @return bool Returns whether the language key is set. * @return bool Returns whether the language key is set.
*/ */

View file

@ -25,7 +25,7 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
private $name; private $name;
/** /**
* @var \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE Super global constant. * @var string (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE) Super global constant.
*/ */
private $super_global; private $super_global;
@ -39,7 +39,7 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
* *
* @param \phpbb\request\request_interface $request A request class instance holding the real super global data. * @param \phpbb\request\request_interface $request A request class instance holding the real super global data.
* @param string $name Name of the super global this is a replacement for - e.g. '_GET'. * @param string $name Name of the super global this is a replacement for - e.g. '_GET'.
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global The variable's super global constant. * @param string $super_global The variable's super global constant (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE).
*/ */
public function __construct(\phpbb\request\request_interface $request, $name, $super_global) public function __construct(\phpbb\request\request_interface $request, $name, $super_global)
{ {

View file

@ -39,7 +39,7 @@ class request implements \phpbb\request\request_interface
protected $original_request = null; protected $original_request = null;
/** /**
* @var * @var bool
*/ */
protected $super_globals_disabled = false; protected $super_globals_disabled = false;
@ -137,11 +137,11 @@ class request implements \phpbb\request\request_interface
* other methods this class provides. Using this function should be avoided if possible! It will * other methods this class provides. Using this function should be avoided if possible! It will
* consume twice the the amount of memory of the value * consume twice the the amount of memory of the value
* *
* @param string $var_name The name of the variable that shall be overwritten * @param string $var_name The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain. * @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset. * If this is null the variable will be unset.
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global shall be changed * Specifies which super global shall be changed
*/ */
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST) public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{ {
@ -173,16 +173,16 @@ class request implements \phpbb\request\request_interface
* Central type safe input handling function. * Central type safe input handling function.
* All variables in GET or POST requests should be retrieved through this function to maximise security. * All variables in GET or POST requests should be retrieved through this function to maximise security.
* *
* @param string|array $var_name The form variable's name from which data shall be retrieved. * @param string|array $var_name The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give * If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a". * then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set. * @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default. * This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used * Specifies which super global should be used
* *
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned. * the same as that of $default. If the variable is not set $default is returned.
@ -197,16 +197,16 @@ class request implements \phpbb\request\request_interface
* Same functionality as variable(), except does not run trim() on strings. * Same functionality as variable(), except does not run trim() on strings.
* This method should be used when handling passwords. * This method should be used when handling passwords.
* *
* @param string|array $var_name The form variable's name from which data shall be retrieved. * @param string|array $var_name The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give * If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a". * then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set. * @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default. * This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used * Specifies which super global should be used
* *
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned. * the same as that of $default. If the variable is not set $default is returned.
@ -334,11 +334,11 @@ class request implements \phpbb\request\request_interface
* Checks whether a certain variable is set in one of the super global * Checks whether a certain variable is set in one of the super global
* arrays. * arrays.
* *
* @param string $var Name of the variable * @param string $var Name of the variable
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies the super global which shall be checked * Specifies the super global which shall be checked
* *
* @return bool True if the variable was sent as input * @return bool True if the variable was sent as input
*/ */
public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST) public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{ {
@ -370,8 +370,8 @@ class request implements \phpbb\request\request_interface
/** /**
* Returns all variable names for a given super global * Returns all variable names for a given super global
* *
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* The super global from which names shall be taken * The super global from which names shall be taken
* *
* @return array All variable names that are set for the super global. * @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised! * Pay attention when using these, they are unsanitised!
@ -389,17 +389,17 @@ class request implements \phpbb\request\request_interface
/** /**
* Helper function used by variable() and untrimmed_variable(). * Helper function used by variable() and untrimmed_variable().
* *
* @param string|array $var_name The form variable's name from which data shall be retrieved. * @param string|array $var_name The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give * If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a". * then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set. * @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default. * This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used * Specifies which super global should be used
* @param bool $trim Indicates whether trim() should be applied to string values. * @param bool $trim Indicates whether trim() should be applied to string values.
* *
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned. * the same as that of $default. If the variable is not set $default is returned.

View file

@ -36,11 +36,11 @@ interface request_interface
* other methods this class provides. Using this function should be avoided if possible! It will * other methods this class provides. Using this function should be avoided if possible! It will
* consume twice the the amount of memory of the value * consume twice the the amount of memory of the value
* *
* @param string $var_name The name of the variable that shall be overwritten * @param string $var_name The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain. * @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset. * If this is null the variable will be unset.
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global shall be changed * Specifies which super global shall be changed
*/ */
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST); public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST);
@ -56,8 +56,8 @@ interface request_interface
* This function will always return a value of the same type as the default. * This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used * Specifies which super global shall be changed
* *
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned. * the same as that of $default. If the variable is not set $default is returned.
@ -78,8 +78,8 @@ interface request_interface
* then specifying array("var", 1) as the name will return "a". * then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set. * @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default. * This function will always return a value of the same type as the default.
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used * Specifies which super global shall be changed
* *
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned. * the same as that of $default. If the variable is not set $default is returned.
@ -122,11 +122,11 @@ interface request_interface
* Checks whether a certain variable is set in one of the super global * Checks whether a certain variable is set in one of the super global
* arrays. * arrays.
* *
* @param string $var Name of the variable * @param string $var Name of the variable
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies the super global which shall be checked * Specifies which super global shall be changed
* *
* @return bool True if the variable was sent as input * @return bool True if the variable was sent as input
*/ */
public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST); public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST);
@ -147,8 +147,8 @@ interface request_interface
/** /**
* Returns all variable names for a given super global * Returns all variable names for a given super global
* *
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* The super global from which names shall be taken * The super global from which names shall be taken
* *
* @return array All variable names that are set for the super global. * @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised! * Pay attention when using these, they are unsanitised!
@ -158,8 +158,8 @@ interface request_interface
/** /**
* Returns the original array of the requested super global * Returns the original array of the requested super global
* *
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* The super global which will be returned * The super global which will be returned
* *
* @return array The original array of the requested super global. * @return array The original array of the requested super global.
*/ */

View file

@ -138,7 +138,7 @@ class extension extends \Twig\Extension\AbstractExtension
* @param mixed $item A variable * @param mixed $item A variable
* @param integer $start Start of the subset * @param integer $start Start of the subset
* @param integer $end End of the subset * @param integer $end End of the subset
* @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) * @param boolean $preserveKeys Whether to preserve key or not (when the input is an array)
* *
* @return mixed The sliced variable * @return mixed The sliced variable
*/ */

View file

@ -31,8 +31,8 @@ class phpbb_mock_session_testable extends \phpbb\session
/** /**
* Checks if the cookies were set correctly. * Checks if the cookies were set correctly.
* *
* @param PHPUnit\Framework\Assert test The test from which this is called * @param PHPUnit\Framework\Assert $test The test from which this is called
* @param array(string => mixed) cookies The cookie data to check against. * @param array<string,mixed> $cookies The cookie data to check against.
* The keys are cookie names, the values can either be null to * The keys are cookie names, the values can either be null to
* check only the existence of the cookie, or an array(d, t), * check only the existence of the cookie, or an array(d, t),
* where d is the cookie data to check, or null to skip the * where d is the cookie data to check, or null to skip the