Skip to content

Commit

Permalink
Fix some coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriim committed Mar 25, 2024
1 parent ffa7792 commit f532f9a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions classes/local/tool_dynamic_cohorts/condition/fields_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ trait fields_trait {
*
* @return array A list of operators.
*/
protected function get_text_operators() : array {
protected function get_text_operators(): array {
return [
self::TEXT_CONTAINS => get_string('contains', 'filters'),
self::TEXT_DOES_NOT_CONTAIN => get_string('doesnotcontain', 'filters'),
Expand All @@ -50,7 +50,7 @@ protected function get_text_operators() : array {
*
* @return array A list of operators.
*/
protected function get_menu_operators() : array {
protected function get_menu_operators(): array {
return [
self::TEXT_IS_EQUAL_TO => get_string('isequalto', 'filters'),
self::TEXT_IS_NOT_EQUAL_TO => get_string('isnotequalto', 'filters'),
Expand Down
4 changes: 2 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class provider implements \core_privacy\local\metadata\provider,
* @param collection $collection a reference to the collection to use to store the metadata.
* @return collection the updated collection of metadata items.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_database_table(
'tool_dynamic_cohorts',
[
Expand Down Expand Up @@ -71,7 +71,7 @@ public static function get_metadata(collection $collection) : collection {
* @param int $userid the userid.
* @return contextlist the list of contexts containing user info for the user.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
public static function get_contexts_for_userid(int $userid): contextlist {
global $DB;
$contextlist = new contextlist();

Expand Down
2 changes: 1 addition & 1 deletion classes/rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function get_condition_records(): array {
*
* @return bool
*/
public function is_enabled() : bool {
public function is_enabled(): bool {
return (bool) $this->get('enabled');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function test_set_and_get_configdata() {
*
* @return array[]
*/
public function config_description_data_provider(): array {
public static function config_description_data_provider(): array {
return [
[condition_base::TEXT_CONTAINS, 'A user is not member of cohorts with field \'Theme\' contains 123'],
[condition_base::TEXT_DOES_NOT_CONTAIN, 'A user is not member of cohorts with field \'Theme\' doesn\'t contain 123'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function test_set_and_get_configdata() {
*
* @return array[]
*/
public function config_description_data_provider(): array {
public static function config_description_data_provider(): array {
return [
[condition_base::TEXT_CONTAINS, 'Test field1 contains 123', true],
[condition_base::TEXT_DOES_NOT_CONTAIN, 'Test field1 doesn\'t contain 123', true],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function test_set_and_get_configdata() {
*
* @return array[]
*/
public function config_description_data_provider(): array {
public static function config_description_data_provider(): array {
return [
[condition_base::TEXT_CONTAINS, 'First name contains 123'],
[condition_base::TEXT_DOES_NOT_CONTAIN, 'First name doesn\'t contain 123'],
Expand Down
2 changes: 1 addition & 1 deletion tests/rule_manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function test_build_rule_data_for_form() {
*
* @return array
*/
public function process_rule_form_with_invalid_data_provider(): array {
public static function process_rule_form_with_invalid_data_provider(): array {
return [
[[]],
[['name' => 'Test']],
Expand Down

0 comments on commit f532f9a

Please sign in to comment.