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
@@ -42,7 +42,7 @@ class user_profile_set extends \core_analytics\local\indicator\linear {
*
* @return \lang_string
*/
public static function get_name() : \lang_string {
public static function get_name(): \lang_string {
return new \lang_string('indicator:completeduserprofile');
}
@@ -42,7 +42,7 @@ class user_track_forums extends \core_analytics\local\indicator\binary {
*
* @return \lang_string
*/
public static function get_name() : \lang_string {
public static function get_name(): \lang_string {
return new \lang_string('indicator:userforumstracking');
}
@@ -71,7 +71,7 @@ class upcoming_activities_due extends \core_analytics\local\target\binary {
*
* @return \lang_string
*/
public static function get_name() : \lang_string {
public static function get_name(): \lang_string {
return new \lang_string('target:upcomingactivitiesdue', 'user');
}
+1 -1
View File
@@ -41,7 +41,7 @@ class calendar_form extends \moodleform {
/**
* Define the form.
*/
public function definition () {
public function definition() {
global $CFG, $USER;
$mform = $this->_form;
@@ -34,7 +34,7 @@ class contentbank_user_preferences_form extends \moodleform {
/**
* Define the form.
*/
public function definition () {
public function definition() {
global $CFG, $USER;
$mform = $this->_form;
+1 -1
View File
@@ -41,7 +41,7 @@ class defaulthomepage_form extends \moodleform {
/**
* Define the form.
*/
public function definition () {
public function definition() {
global $CFG;
$mform = $this->_form;
+2 -2
View File
@@ -38,7 +38,7 @@ class profile_field_form extends dynamic_form {
/**
* Define the form
*/
public function definition () {
public function definition() {
global $CFG;
require_once($CFG->dirroot.'/user/profile/definelib.php');
@@ -65,7 +65,7 @@ class profile_field_form extends dynamic_form {
/**
* Alter definition based on existing or submitted data
*/
public function definition_after_data () {
public function definition_after_data() {
$mform = $this->_form;
$this->field->define_after_data($mform);
}
+2 -2
View File
@@ -53,7 +53,7 @@ class provider implements
* @param collection $collection A list of information about this component
* @return collection The collection object filled out with information about this component.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$userfields = [
'id' => 'privacy:metadata:id',
'auth' => 'privacy:metadata:auth',
@@ -192,7 +192,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 {
$params = ['userid' => $userid, 'contextuser' => CONTEXT_USER];
$sql = "SELECT id
FROM {context}
+1 -1
View File
@@ -212,7 +212,7 @@ class user extends \core_search\base {
*
* @return \core_search\document_icon
*/
public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon {
public function get_doc_icon(\core_search\document $doc): \core_search\document_icon {
return new \core_search\document_icon('i/user');
}