mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 05:28:30 +01:00
MDL-75548 misc: final Required parameter follows optional notices
This commit is contained in:
parent
17ee072693
commit
797b9fbd62
@ -323,7 +323,7 @@ class accessibility {
|
||||
/**
|
||||
* This function runs one specified check on the html item
|
||||
*
|
||||
* @param string $html The html string to be analysed; might be NULL.
|
||||
* @param string|null $html The html string to be analysed; might be NULL.
|
||||
* @param int $contentid The content area ID
|
||||
* @param int $errid The error ID
|
||||
* @param string $check The check name to run
|
||||
@ -333,7 +333,7 @@ class accessibility {
|
||||
* @throws \dml_exception
|
||||
*/
|
||||
public static function run_one_check(
|
||||
string $html = null,
|
||||
?string $html,
|
||||
int $contentid,
|
||||
int $errid,
|
||||
string $check,
|
||||
|
@ -482,13 +482,13 @@ class tree extends tree_node {
|
||||
*
|
||||
* @param bool $not True if there is a NOT in effect
|
||||
* @param info $info Information about location of condition tree
|
||||
* @param result $result Result object if this is a student display, else null
|
||||
* @param result|null $result Result object if this is a student display, else null
|
||||
* @param bool $root True if this is the root item
|
||||
* @param bool $hidden Staff display; true if this tree has show=false (from parent)
|
||||
* @return string|renderable Information to render
|
||||
*/
|
||||
protected function get_full_information_recursive(
|
||||
$not, info $info, result $result = null, $root, $hidden = false) {
|
||||
$not, info $info, ?result $result, $root, $hidden = false) {
|
||||
// Get list of children - either full list, or those which are shown.
|
||||
$children = $this->children;
|
||||
$staff = true;
|
||||
|
@ -118,16 +118,16 @@ class event implements event_interface {
|
||||
* @param int $id The event's ID in the database.
|
||||
* @param string $name The event's name.
|
||||
* @param description_interface $description The event's description.
|
||||
* @param proxy_interface $category The category associated with the event.
|
||||
* @param proxy_interface $course The course associated with the event.
|
||||
* @param proxy_interface $group The group associated with the event.
|
||||
* @param proxy_interface $user The user associated with the event.
|
||||
* @param event_collection_interface $repeats Collection of repeat events.
|
||||
* @param proxy_interface $coursemodule The course module that created the event.
|
||||
* @param proxy_interface|null $category The category associated with the event.
|
||||
* @param proxy_interface|null $course The course associated with the event.
|
||||
* @param proxy_interface|null $group The group associated with the event.
|
||||
* @param proxy_interface|null $user The user associated with the event.
|
||||
* @param event_collection_interface|null $repeats Collection of repeat events.
|
||||
* @param proxy_interface|null $coursemodule The course module that created the event.
|
||||
* @param string $type The event's type.
|
||||
* @param times_interface $times The times associated with the event.
|
||||
* @param bool $visible The event's visibility. True for visible, false for invisible.
|
||||
* @param proxy_interface $subscription The event's subscription.
|
||||
* @param proxy_interface|null $subscription The event's subscription.
|
||||
* @param string $location The event's location.
|
||||
* @param string $component The event's component.
|
||||
*/
|
||||
@ -135,12 +135,12 @@ class event implements event_interface {
|
||||
$id,
|
||||
$name,
|
||||
description_interface $description,
|
||||
proxy_interface $category = null,
|
||||
proxy_interface $course = null,
|
||||
proxy_interface $group = null,
|
||||
proxy_interface $user = null,
|
||||
event_collection_interface $repeats = null,
|
||||
proxy_interface $coursemodule = null,
|
||||
?proxy_interface $category,
|
||||
?proxy_interface $course,
|
||||
?proxy_interface $group,
|
||||
?proxy_interface $user,
|
||||
?event_collection_interface $repeats,
|
||||
?proxy_interface $coursemodule,
|
||||
$type,
|
||||
times_interface $times,
|
||||
$visible,
|
||||
|
@ -69,10 +69,10 @@ class bankcontent implements renderable, templatable {
|
||||
*
|
||||
* @param \core_contentbank\content[] $contents Array of content bank contents.
|
||||
* @param array $toolbar List of content bank toolbar options.
|
||||
* @param \context $context Optional context to check (default null)
|
||||
* @param \context|null $context Optional context to check (default null)
|
||||
* @param contentbank $cb Contenbank object.
|
||||
*/
|
||||
public function __construct(array $contents, array $toolbar, \context $context = null, contentbank $cb) {
|
||||
public function __construct(array $contents, array $toolbar, ?\context $context, contentbank $cb) {
|
||||
$this->contents = $contents;
|
||||
$this->toolbar = $toolbar;
|
||||
$this->context = $context;
|
||||
|
@ -415,12 +415,12 @@ abstract class moodle_database {
|
||||
/**
|
||||
* This should be called before each db query.
|
||||
* @param string $sql The query string.
|
||||
* @param array $params An array of parameters.
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type The type of query. ( SQL_QUERY_SELECT | SQL_QUERY_AUX | SQL_QUERY_INSERT | SQL_QUERY_UPDATE | SQL_QUERY_STRUCTURE )
|
||||
* @param mixed $extrainfo This is here for any driver specific extra information.
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo=null) {
|
||||
if ($this->loggingquery) {
|
||||
return;
|
||||
}
|
||||
|
@ -262,12 +262,12 @@ trait moodle_read_slave_trait {
|
||||
/**
|
||||
* Called before each db query.
|
||||
* @param string $sql
|
||||
* @param array $params array of parameters
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params = null, $type, $extrainfo = null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo = null) {
|
||||
parent::query_start($sql, $params, $type, $extrainfo);
|
||||
$this->select_db_handle($type, $sql);
|
||||
}
|
||||
|
@ -245,12 +245,12 @@ class oci_native_moodle_database extends moodle_database {
|
||||
/**
|
||||
* Called before each db query.
|
||||
* @param string $sql
|
||||
* @param array array of parameters
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo=null) {
|
||||
parent::query_start($sql, $params, $type, $extrainfo);
|
||||
// oci driver tents to send debug to output, we do not need that ;-)
|
||||
$this->last_error_reporting = error_reporting(0);
|
||||
|
@ -614,12 +614,12 @@ abstract class pdo_moodle_database extends moodle_database {
|
||||
* Overridden to ensure $this->lastErorr is reset each query
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array array of parameters
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo=null) {
|
||||
$this->lastError = null;
|
||||
parent::query_start($sql, $params, $type, $extrainfo);
|
||||
}
|
||||
|
@ -315,12 +315,12 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
/**
|
||||
* Called before each db query.
|
||||
* @param string $sql
|
||||
* @param array array of parameters
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo=null) {
|
||||
$this->read_slave_query_start($sql, $params, $type, $extrainfo);
|
||||
// pgsql driver tends to send debug to output, we do not need that.
|
||||
$this->last_error_reporting = error_reporting(0);
|
||||
|
@ -306,12 +306,12 @@ class sqlsrv_native_moodle_database extends moodle_database {
|
||||
/**
|
||||
* Called before each db query.
|
||||
* @param string $sql
|
||||
* @param array $params array of parameters
|
||||
* @param array|null $params An array of parameters.
|
||||
* @param int $type type of query
|
||||
* @param mixed $extrainfo driver specific extra information
|
||||
* @return void
|
||||
*/
|
||||
protected function query_start($sql, array $params = null, $type, $extrainfo = null) {
|
||||
protected function query_start($sql, ?array $params, $type, $extrainfo = null) {
|
||||
parent::query_start($sql, $params, $type, $extrainfo);
|
||||
}
|
||||
|
||||
|
@ -91,12 +91,12 @@ class read_slave_moodle_database extends test_moodle_database {
|
||||
/**
|
||||
* Query wrapper that calls query_start() and query_end()
|
||||
* @param string $sql
|
||||
* @param array $params
|
||||
* @param array|null $params
|
||||
* @param int $querytype
|
||||
* @param ?callable $callback
|
||||
* @return string $handle handle property
|
||||
*/
|
||||
public function with_query_start_end($sql, array $params = null, $querytype, $callback = null) {
|
||||
public function with_query_start_end($sql, ?array $params, $querytype, $callback = null) {
|
||||
$this->query_start($sql, $params, $querytype);
|
||||
$ret = $this->handle;
|
||||
if ($callback) {
|
||||
|
@ -95,11 +95,11 @@ trait test_moodle_read_slave_trait {
|
||||
/**
|
||||
* Upgrade to public
|
||||
* @param string $sql
|
||||
* @param array $params
|
||||
* @param array|null $params
|
||||
* @param int $type
|
||||
* @param array $extrainfo
|
||||
*/
|
||||
public function query_start($sql, array $params = null, $type, $extrainfo = null) {
|
||||
public function query_start($sql, ?array $params, $type, $extrainfo = null) {
|
||||
return parent::query_start($sql, $params, $type);
|
||||
}
|
||||
|
||||
|
@ -544,12 +544,12 @@ class tgz_packer extends file_packer {
|
||||
* @param array $expandedfiles List of all files to archive (output)
|
||||
* @param string $archivepath Current path within archive
|
||||
* @param string $path OS path on disk
|
||||
* @param file_progress $progress Progress indicator or null if none
|
||||
* @param file_progress|null $progress Progress indicator or null if none
|
||||
* @param int $done Value for progress indicator
|
||||
* @return bool True if successful
|
||||
*/
|
||||
protected function list_files_path(array &$expandedfiles, $archivepath, $path,
|
||||
file_progress $progress = null, $done) {
|
||||
?file_progress $progress , $done) {
|
||||
if (is_dir($path)) {
|
||||
// Unless we're using this directory as archive root, add a
|
||||
// directory entry.
|
||||
|
@ -786,13 +786,13 @@ function validate_param($param, $type, $allownull=NULL_NOT_ALLOWED, $debuginfo='
|
||||
* $options = clean_param($options, PARAM_INT);
|
||||
* </code>
|
||||
*
|
||||
* @param array $param the variable array we are cleaning
|
||||
* @param array|null $param the variable array we are cleaning
|
||||
* @param string $type expected format of param after cleaning.
|
||||
* @param bool $recursive clean recursive arrays
|
||||
* @return array
|
||||
* @throws coding_exception
|
||||
*/
|
||||
function clean_param_array(array $param = null, $type, $recursive = false) {
|
||||
function clean_param_array(?array $param, $type, $recursive = false) {
|
||||
// Convert null to empty array.
|
||||
$param = (array)$param;
|
||||
foreach ($param as $key => $value) {
|
||||
|
@ -4742,12 +4742,12 @@ class action_menu_link extends action_link implements renderable {
|
||||
* Constructs the object.
|
||||
*
|
||||
* @param moodle_url $url The URL for the action.
|
||||
* @param pix_icon $icon The icon to represent the action.
|
||||
* @param pix_icon|null $icon The icon to represent the action.
|
||||
* @param string $text The text to represent the action.
|
||||
* @param bool $primary Whether this is a primary action or not.
|
||||
* @param array $attributes Any attribtues associated with the action.
|
||||
*/
|
||||
public function __construct(moodle_url $url, pix_icon $icon = null, $text, $primary = true, array $attributes = array()) {
|
||||
public function __construct(moodle_url $url, ?pix_icon $icon, $text, $primary = true, array $attributes = array()) {
|
||||
parent::__construct($url, $text, null, $attributes, $icon);
|
||||
$this->primary = (bool)$primary;
|
||||
$this->add_class('menu-action');
|
||||
@ -4813,11 +4813,11 @@ class action_menu_link_primary extends action_menu_link {
|
||||
* Constructs the object.
|
||||
*
|
||||
* @param moodle_url $url
|
||||
* @param pix_icon $icon
|
||||
* @param pix_icon|null $icon
|
||||
* @param string $text
|
||||
* @param array $attributes
|
||||
*/
|
||||
public function __construct(moodle_url $url, pix_icon $icon = null, $text, array $attributes = array()) {
|
||||
public function __construct(moodle_url $url, ?pix_icon $icon, $text, array $attributes = array()) {
|
||||
parent::__construct($url, $icon, $text, true, $attributes);
|
||||
}
|
||||
}
|
||||
@ -4835,11 +4835,11 @@ class action_menu_link_secondary extends action_menu_link {
|
||||
* Constructs the object.
|
||||
*
|
||||
* @param moodle_url $url
|
||||
* @param pix_icon $icon
|
||||
* @param pix_icon|null $icon
|
||||
* @param string $text
|
||||
* @param array $attributes
|
||||
*/
|
||||
public function __construct(moodle_url $url, pix_icon $icon = null, $text, array $attributes = array()) {
|
||||
public function __construct(moodle_url $url, ?pix_icon $icon, $text, array $attributes = array()) {
|
||||
parent::__construct($url, $icon, $text, false, $attributes);
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ abstract class base_message extends \core_search\base {
|
||||
* @return \moodle_recordset|null Recordset or null if no results possible
|
||||
* @throws \coding_exception If context invalid
|
||||
*/
|
||||
protected function get_document_recordset_helper($modifiedfrom, \context $context = null,
|
||||
protected function get_document_recordset_helper($modifiedfrom, ?\context $context,
|
||||
$userfield) {
|
||||
global $DB;
|
||||
|
||||
|
@ -452,7 +452,7 @@ abstract class base {
|
||||
* @return array Array with SQL and parameters; both null if no need to query
|
||||
* @throws \coding_exception If called with invalid params
|
||||
*/
|
||||
protected function get_course_level_context_restriction_sql(\context $context = null,
|
||||
protected function get_course_level_context_restriction_sql(?\context $context,
|
||||
$coursetable, $paramtype = SQL_PARAMS_QM) {
|
||||
global $DB;
|
||||
|
||||
|
@ -109,7 +109,7 @@ abstract class base_mod extends base {
|
||||
* @return array Array with SQL and parameters; both null if no need to query
|
||||
* @throws \coding_exception If called with invalid params
|
||||
*/
|
||||
protected function get_context_restriction_sql(\context $context = null, $modname, $modtable,
|
||||
protected function get_context_restriction_sql(?\context $context, $modname, $modtable,
|
||||
$paramtype = SQL_PARAMS_QM) {
|
||||
global $DB;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user