mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 19:36:41 +02:00
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle
This commit is contained in:
commit
3278ce7aba
1147 changed files with 2621 additions and 2617 deletions
|
@ -74,7 +74,7 @@ abstract class event_abstract_factory implements event_factory_interface {
|
|||
* @param event_interface $event The event to be updated.
|
||||
* @return event_interface The potentially modified event.
|
||||
*/
|
||||
protected abstract function apply_component_action(event_interface $event);
|
||||
abstract protected function apply_component_action(event_interface $event);
|
||||
|
||||
/**
|
||||
* Exposes the event (or not).
|
||||
|
@ -82,7 +82,7 @@ abstract class event_abstract_factory implements event_factory_interface {
|
|||
* @param event_interface $event The event to potentially expose.
|
||||
* @return event_interface|null The exposed event or null.
|
||||
*/
|
||||
protected abstract function expose_event(event_interface $event);
|
||||
abstract protected function expose_event(event_interface $event);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -81,7 +81,7 @@ class coursecat_proxy implements proxy_interface {
|
|||
*
|
||||
* @return \core_course_category
|
||||
*/
|
||||
public function get_proxied_instance() : \core_course_category {
|
||||
public function get_proxied_instance(): \core_course_category {
|
||||
if (!$this->category) {
|
||||
$this->category = \core_course_category::get($this->id, IGNORE_MISSING, true);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class provider implements
|
|||
* @param collection $collection A collection of meta data items to be added to.
|
||||
* @return collection Returns the collection of metadata.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
// The calendar 'event' table contains user data.
|
||||
$collection->add_database_table(
|
||||
'event',
|
||||
|
@ -94,7 +94,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$contextlist = new contextlist();
|
||||
|
||||
// Calendar Events can exist at Site, Course Category, Course, Course Group, User, or Course Modules contexts.
|
||||
|
|
|
@ -35,7 +35,7 @@ abstract class type_base {
|
|||
*
|
||||
* @return string the calendar name
|
||||
*/
|
||||
public abstract function get_name();
|
||||
abstract public function get_name();
|
||||
|
||||
/**
|
||||
* Returns a list of all the possible days for all months.
|
||||
|
@ -49,28 +49,28 @@ abstract class type_base {
|
|||
*
|
||||
* @return array the days
|
||||
*/
|
||||
public abstract function get_days();
|
||||
abstract public function get_days();
|
||||
|
||||
/**
|
||||
* Returns a list of all the names of the months.
|
||||
*
|
||||
* @return array the month names
|
||||
*/
|
||||
public abstract function get_months();
|
||||
abstract public function get_months();
|
||||
|
||||
/**
|
||||
* Returns the minimum year for the calendar.
|
||||
*
|
||||
* @return int The minimum year
|
||||
*/
|
||||
public abstract function get_min_year();
|
||||
abstract public function get_min_year();
|
||||
|
||||
/**
|
||||
* Returns the maximum year for the calendar
|
||||
*
|
||||
* @return int The maximum year
|
||||
*/
|
||||
public abstract function get_max_year();
|
||||
abstract public function get_max_year();
|
||||
|
||||
/**
|
||||
* Returns an array of years.
|
||||
|
@ -79,7 +79,7 @@ abstract class type_base {
|
|||
* @param int $maxyear
|
||||
* @return array the years
|
||||
*/
|
||||
public abstract function get_years($minyear = null, $maxyear = null);
|
||||
abstract public function get_years($minyear = null, $maxyear = null);
|
||||
|
||||
/**
|
||||
* Returns a multidimensional array with information for day, month, year
|
||||
|
@ -91,14 +91,14 @@ abstract class type_base {
|
|||
* @param int $maxyear The year to finish with
|
||||
* @return array Full date information
|
||||
*/
|
||||
public abstract function get_date_order($minyear = null, $maxyear = null);
|
||||
abstract public function get_date_order($minyear = null, $maxyear = null);
|
||||
|
||||
/**
|
||||
* Returns the number of days in a week.
|
||||
*
|
||||
* @return int the number of days
|
||||
*/
|
||||
public abstract function get_num_weekdays();
|
||||
abstract public function get_num_weekdays();
|
||||
|
||||
/**
|
||||
* Returns an indexed list of all the names of the weekdays.
|
||||
|
@ -109,7 +109,7 @@ abstract class type_base {
|
|||
*
|
||||
* @return array array of days
|
||||
*/
|
||||
public abstract function get_weekdays();
|
||||
abstract public function get_weekdays();
|
||||
|
||||
/**
|
||||
* Returns the index of the starting week day.
|
||||
|
@ -119,7 +119,7 @@ abstract class type_base {
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
public abstract function get_starting_weekday();
|
||||
abstract public function get_starting_weekday();
|
||||
|
||||
/**
|
||||
* Returns the index of the weekday for a specific calendar date.
|
||||
|
@ -129,7 +129,7 @@ abstract class type_base {
|
|||
* @param int $day
|
||||
* @return int
|
||||
*/
|
||||
public abstract function get_weekday($year, $month, $day);
|
||||
abstract public function get_weekday($year, $month, $day);
|
||||
|
||||
/**
|
||||
* Returns the number of days in a given month.
|
||||
|
@ -139,7 +139,7 @@ abstract class type_base {
|
|||
* @param int $month
|
||||
* @return int the number of days
|
||||
*/
|
||||
public abstract function get_num_days_in_month($year, $month);
|
||||
abstract public function get_num_days_in_month($year, $month);
|
||||
|
||||
/**
|
||||
* Get the previous month.
|
||||
|
@ -148,7 +148,7 @@ abstract class type_base {
|
|||
* @param int $month
|
||||
* @return array previous month and year
|
||||
*/
|
||||
public abstract function get_prev_month($year, $month);
|
||||
abstract public function get_prev_month($year, $month);
|
||||
|
||||
/**
|
||||
* Get the next month.
|
||||
|
@ -157,7 +157,7 @@ abstract class type_base {
|
|||
* @param int $month
|
||||
* @return array the following month and year
|
||||
*/
|
||||
public abstract function get_next_month($year, $month);
|
||||
abstract public function get_next_month($year, $month);
|
||||
|
||||
/**
|
||||
* Returns a formatted string that represents a date in user time.
|
||||
|
@ -172,7 +172,7 @@ abstract class type_base {
|
|||
* if false then the leading zero is maintained
|
||||
* @return string the formatted date/time
|
||||
*/
|
||||
public abstract function timestamp_to_date_string($time, $format, $timezone, $fixday, $fixhour);
|
||||
abstract public function timestamp_to_date_string($time, $format, $timezone, $fixday, $fixhour);
|
||||
|
||||
/**
|
||||
* Given a $time timestamp in GMT (seconds since epoch), returns an array that represents
|
||||
|
@ -183,7 +183,7 @@ abstract class type_base {
|
|||
* {@link https://moodledev.io/docs/apis/subsystems/time#timezone}
|
||||
* @return array an array that represents the date in user time
|
||||
*/
|
||||
public abstract function timestamp_to_date_array($time, $timezone = 99);
|
||||
abstract public function timestamp_to_date_array($time, $timezone = 99);
|
||||
|
||||
/**
|
||||
* Provided with a day, month, year, hour and minute in the specific
|
||||
|
@ -196,7 +196,7 @@ abstract class type_base {
|
|||
* @param int $minute
|
||||
* @return array the converted date
|
||||
*/
|
||||
public abstract function convert_to_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
||||
abstract public function convert_to_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
||||
|
||||
/**
|
||||
* Provided with a day, month, year, hour and minute in a Gregorian date
|
||||
|
@ -209,14 +209,14 @@ abstract class type_base {
|
|||
* @param int $minute
|
||||
* @return array the converted date
|
||||
*/
|
||||
public abstract function convert_from_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
||||
abstract public function convert_from_gregorian($year, $month, $day, $hour = 0, $minute = 0);
|
||||
|
||||
/**
|
||||
* This return locale for windows os.
|
||||
*
|
||||
* @return string locale
|
||||
*/
|
||||
public abstract function locale_win_charset();
|
||||
abstract public function locale_win_charset();
|
||||
|
||||
/**
|
||||
* Provided with a day, month, year, hour and minute in the specific
|
||||
|
|
|
@ -42,7 +42,7 @@ class event_form extends moodleform {
|
|||
/**
|
||||
* The form definition
|
||||
*/
|
||||
function definition () {
|
||||
function definition() {
|
||||
global $CFG, $USER, $OUTPUT;
|
||||
$mform = $this->_form;
|
||||
$newevent = (empty($this->_customdata->event) || empty($this->_customdata->event->id));
|
||||
|
|
|
@ -114,7 +114,7 @@ class core_calendar_external extends external_api {
|
|||
* @return \core_external\external_description
|
||||
* @since Moodle 2.5
|
||||
*/
|
||||
public static function delete_calendar_events_returns() {
|
||||
public static function delete_calendar_events_returns() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ class core_calendar_external extends external_api {
|
|||
* @return \core_external\external_description
|
||||
* @since Moodle 2.5
|
||||
*/
|
||||
public static function get_calendar_events_returns() {
|
||||
public static function get_calendar_events_returns() {
|
||||
return new external_single_structure(array(
|
||||
'events' => new external_multiple_structure( new external_single_structure(
|
||||
array(
|
||||
|
@ -760,7 +760,7 @@ class core_calendar_external extends external_api {
|
|||
* @return \core_external\external_description.
|
||||
* @since Moodle 2.5
|
||||
*/
|
||||
public static function create_calendar_events_returns() {
|
||||
public static function create_calendar_events_returns() {
|
||||
return new external_single_structure(
|
||||
array(
|
||||
'events' => new external_multiple_structure( new external_single_structure(
|
||||
|
@ -989,7 +989,7 @@ class core_calendar_external extends external_api {
|
|||
*
|
||||
* @return \core_external\external_description.
|
||||
*/
|
||||
public static function submit_create_update_form_returns() {
|
||||
public static function submit_create_update_form_returns() {
|
||||
$eventstructure = event_exporter::get_read_structure();
|
||||
$eventstructure->required = VALUE_OPTIONAL;
|
||||
|
||||
|
@ -1329,7 +1329,7 @@ class core_calendar_external extends external_api {
|
|||
* @return \core_external\external_description.
|
||||
* @since Moodle 3.7
|
||||
*/
|
||||
public static function get_calendar_access_information_returns() {
|
||||
public static function get_calendar_access_information_returns() {
|
||||
|
||||
return new external_single_structure(
|
||||
[
|
||||
|
@ -1389,7 +1389,7 @@ class core_calendar_external extends external_api {
|
|||
* @return \core_external\external_description.
|
||||
* @since Moodle 3.7
|
||||
*/
|
||||
public static function get_allowed_event_types_returns() {
|
||||
public static function get_allowed_event_types_returns() {
|
||||
|
||||
return new external_single_structure(
|
||||
[
|
||||
|
|
|
@ -1121,7 +1121,7 @@ class calendar_information {
|
|||
* If a courseid is specified, this value is ignored.
|
||||
* @return calendar_information
|
||||
*/
|
||||
public static function create($time, int $courseid, int $categoryid = null) : calendar_information {
|
||||
public static function create($time, int $courseid, int $categoryid = null): calendar_information {
|
||||
$calendar = new static(0, 0, 0, $time);
|
||||
if ($courseid != SITEID && !empty($courseid)) {
|
||||
// Course ID must be valid and existing.
|
||||
|
|
|
@ -134,7 +134,7 @@ class externallib_test extends externallib_advanced_testcase {
|
|||
return $event->create($prop);
|
||||
}
|
||||
|
||||
public function test_create_calendar_events () {
|
||||
public function test_create_calendar_events() {
|
||||
global $DB, $USER;
|
||||
|
||||
$this->setAdminUser();
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue