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
+6 -6
View File
@@ -81,7 +81,7 @@ abstract class field_controller {
* @throws \coding_exception
* @throws \moodle_exception
*/
public static function create(int $id, \stdClass $record = null, category_controller $category = null) : field_controller {
public static function create(int $id, \stdClass $record = null, category_controller $category = null): field_controller {
global $DB;
if ($id && $record) {
// This warning really should be in persistent as well.
@@ -144,7 +144,7 @@ abstract class field_controller {
* @param array $files
* @return array associative array of error messages
*/
public function config_form_validation(array $data, $files = array()) : array {
public function config_form_validation(array $data, $files = array()): array {
return array();
}
@@ -179,7 +179,7 @@ abstract class field_controller {
*
* @return bool
*/
public function delete() : bool {
public function delete(): bool {
global $DB;
$DB->delete_records('customfield_data', ['fieldid' => $this->get('id')]);
return $this->field->delete();
@@ -208,7 +208,7 @@ abstract class field_controller {
*
* @return category_controller
*/
public final function get_category() : category_controller {
public final function get_category(): category_controller {
return $this->category;
}
@@ -231,7 +231,7 @@ abstract class field_controller {
*
* @return handler
*/
public final function get_handler() : handler {
public final function get_handler(): handler {
return $this->get_category()->get_handler();
}
@@ -257,7 +257,7 @@ abstract class field_controller {
*
* @return string
*/
public function get_formatted_name() : string {
public function get_formatted_name(): string {
$context = $this->get_handler()->get_configuration_context();
return format_string($this->get('name'), true, ['context' => $context]);
}