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
+1 -1
View File
@@ -652,7 +652,7 @@ class cache_factory {
*
* @return core_cache\administration_helper
*/
public static function get_administration_display_helper() : core_cache\administration_helper {
public static function get_administration_display_helper(): core_cache\administration_helper {
if (is_null(self::$displayhelper)) {
self::$displayhelper = new \core_cache\local\administration_display_helper();
}
+1 -1
View File
@@ -440,7 +440,7 @@ class administration_display_helper extends \core_cache\administration_helper {
*
* @return array an array of the form to display to the user, and the page title.
*/
public function action_addstore() : array {
public function action_addstore(): array {
global $PAGE;
$storepluginsummaries = $this->get_store_plugin_summaries();
+1 -1
View File
@@ -377,7 +377,7 @@ class renderer extends \plugin_renderer_base {
*
* @return string
*/
public function additional_lock_actions() : string {
public function additional_lock_actions(): string {
$url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance'));
$select = new single_select($url, 'lock', cache_factory::get_administration_display_helper()->get_addable_lock_options());
$select->label = get_string('addnewlockinstance', 'cache');
+1 -1
View File
@@ -57,7 +57,7 @@ class provider implements
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
// Data is stored in cache stores.
$collection->add_plugintype_link('cachestore', [], 'privacy:metadata:cachestore');
+3 -3
View File
@@ -207,7 +207,7 @@ class cache_disabled extends cache implements cache_loader_with_locking {
* @param int|string $key
* @return bool
*/
public function acquire_lock($key) : bool {
public function acquire_lock($key): bool {
return true;
}
@@ -217,7 +217,7 @@ class cache_disabled extends cache implements cache_loader_with_locking {
* @param int|string $key
* @return bool
*/
public function release_lock($key) : bool {
public function release_lock($key): bool {
return true;
}
@@ -227,7 +227,7 @@ class cache_disabled extends cache implements cache_loader_with_locking {
* @param int|string $key
* @return bool
*/
public function check_lock_state($key) : bool {
public function check_lock_state($key): bool {
return true;
}
}
+1 -1
View File
@@ -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';
}
}
+1 -1
View File
@@ -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';
}
}
+1 -1
View File
@@ -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';
}
}
+3 -3
View File
@@ -981,7 +981,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @param string $ownerid Cache identifier
* @return bool|null
*/
public function check_lock_state($key, $ownerid) : ?bool {
public function check_lock_state($key, $ownerid): ?bool {
if (!array_key_exists($key, $this->locks)) {
return null; // Lock does not exist.
}
@@ -1011,7 +1011,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @return bool
* @throws cache_exception
*/
public function acquire_lock($key, $ownerid) : bool {
public function acquire_lock($key, $ownerid): bool {
$lock = $this->lockfactory->get_lock($key, $this->lockwait);
if ($lock) {
$this->locks[$key][$ownerid] = $lock;
@@ -1026,7 +1026,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @param string $ownerid Cache identifier
* @return bool
*/
public function release_lock($key, $ownerid) : bool {
public function release_lock($key, $ownerid): bool {
if (!array_key_exists($key, $this->locks)) {
return false; // No lock to release.
}
+2 -2
View File
@@ -50,7 +50,7 @@ class provider implements
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_external_location_link('redis', [
'data' => 'privacy:metadata:redis:data',
], 'privacy:metadata:redis');
@@ -63,7 +63,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 {
return new contextlist();
}
+2 -2
View File
@@ -50,7 +50,7 @@ class provider implements
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_subsystem_link('core_user', [], 'privacy:metadata:core_user');
return $collection;
}
@@ -61,7 +61,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 {
return new contextlist();
}
+1 -1
View File
@@ -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';
}
}