MDL-65292 style: Fix all function declarations white space

This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
This commit is contained in:
Eloy Lafuente (stronk7)
2024-02-28 23:33:26 +01:00
parent e567c21d6e
commit ba1f804ffa
972 changed files with 2098 additions and 2094 deletions
@@ -61,7 +61,7 @@ class course_handler extends \core_customfield\handler {
* @param int $itemid
* @return \core_course\customfield\course_handler
*/
public static function create(int $itemid = 0) : \core_customfield\handler {
public static function create(int $itemid = 0): \core_customfield\handler {
if (static::$singleton === null) {
self::$singleton = new static(0);
}
@@ -84,7 +84,7 @@ class course_handler extends \core_customfield\handler {
*
* @return bool true if the current can configure custom fields, false otherwise
*/
public function can_configure() : bool {
public function can_configure(): bool {
return has_capability('moodle/course:configurecustomfields', $this->get_configuration_context());
}
@@ -95,7 +95,7 @@ class course_handler extends \core_customfield\handler {
* @param int $instanceid id of the course to test edit permission
* @return bool true if the current can edit custom fields, false otherwise
*/
public function can_edit(field_controller $field, int $instanceid = 0) : bool {
public function can_edit(field_controller $field, int $instanceid = 0): bool {
if ($instanceid) {
$context = $this->get_instance_context($instanceid);
return (!$field->get_configdata_property('locked') ||
@@ -119,7 +119,7 @@ class course_handler extends \core_customfield\handler {
* @param int $instanceid id of the course to test edit permission
* @return bool true if the current can edit custom fields, false otherwise
*/
public function can_view(field_controller $field, int $instanceid) : bool {
public function can_view(field_controller $field, int $instanceid): bool {
$visibility = $field->get_configdata_property('visibility');
if ($visibility == self::NOTVISIBLE) {
return false;
@@ -146,7 +146,7 @@ class course_handler extends \core_customfield\handler {
*
* @return \context
*/
protected function get_parent_context() : \context {
protected function get_parent_context(): \context {
global $PAGE;
if ($this->parentcontext) {
return $this->parentcontext;
@@ -161,7 +161,7 @@ class course_handler extends \core_customfield\handler {
*
* @return \context the context for configuration
*/
public function get_configuration_context() : \context {
public function get_configuration_context(): \context {
return \context_system::instance();
}
@@ -170,7 +170,7 @@ class course_handler extends \core_customfield\handler {
*
* @return \moodle_url The URL to configure custom fields for this component
*/
public function get_configuration_url() : \moodle_url {
public function get_configuration_url(): \moodle_url {
return new \moodle_url('/course/customfield.php');
}
@@ -180,7 +180,7 @@ class course_handler extends \core_customfield\handler {
* @param int $instanceid id of the record to get the context for
* @return \context the context for the given record
*/
public function get_instance_context(int $instanceid = 0) : \context {
public function get_instance_context(int $instanceid = 0): \context {
if ($instanceid > 0) {
return \context_course::instance($instanceid);
} else {