|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | use ColdTrick\GroupTools\StaleInfo; |
7 | | -use Elgg\Database\AccessCollections; |
8 | 7 | use Elgg\Database\Clauses\OrderByClause; |
9 | 8 | use Elgg\Database\MetadataTable; |
10 | | -use Elgg\Database\RelationshipsTable; |
11 | | -use Elgg\Database\Select; |
12 | 9 | use Elgg\Database\QueryBuilder; |
| 10 | +use Elgg\Database\RelationshipsTable; |
13 | 11 | use Elgg\Security\Base64Url; |
14 | 12 |
|
15 | 13 | /** |
@@ -249,7 +247,7 @@ function group_tools_get_invited_groups_by_email(string $email): array { |
249 | 247 | * @return \ElggGroup[] |
250 | 248 | * @todo revisit this |
251 | 249 | */ |
252 | | -function group_tools_get_suggested_groups(ElggUser $user = null, int $limit = null): array { |
| 250 | +function group_tools_get_suggested_groups(?\ElggUser $user = null, ?int $limit = null): array { |
253 | 251 | if (!$user instanceof \ElggUser) { |
254 | 252 | $user = elgg_get_logged_in_user_entity(); |
255 | 253 | } |
@@ -379,7 +377,7 @@ function (QueryBuilder $qb, $main_alias) { |
379 | 377 | * |
380 | 378 | * @return bool true if the domain of the user is found in the group settings |
381 | 379 | */ |
382 | | -function group_tools_check_domain_based_group(\ElggGroup $group, \ElggUser $user = null): bool { |
| 380 | +function group_tools_check_domain_based_group(\ElggGroup $group, ?\ElggUser $user = null): bool { |
383 | 381 | if (elgg_get_plugin_setting('domain_based', 'group_tools') !== 'yes') { |
384 | 382 | return false; |
385 | 383 | } |
@@ -579,7 +577,7 @@ function group_tools_can_assign_group_admin(\ElggGroup $group): bool { |
579 | 577 | * |
580 | 578 | * @return bool |
581 | 579 | */ |
582 | | -function group_tools_join_motivation_required(\ElggGroup $group = null): bool { |
| 580 | +function group_tools_join_motivation_required(?\ElggGroup $group = null): bool { |
583 | 581 | static $plugin_settings; |
584 | 582 | static $check_group = false; |
585 | 583 |
|
@@ -632,7 +630,7 @@ function group_tools_join_motivation_required(\ElggGroup $group = null): bool { |
632 | 630 | * |
633 | 631 | * @return bool |
634 | 632 | */ |
635 | | -function group_tools_group_mail_enabled(ElggGroup $group = null): bool { |
| 633 | +function group_tools_group_mail_enabled(?\ElggGroup $group = null): bool { |
636 | 634 | static $mail_enabled; |
637 | 635 |
|
638 | 636 | if (!isset($mail_enabled)) { |
@@ -668,7 +666,7 @@ function group_tools_group_mail_enabled(ElggGroup $group = null): bool { |
668 | 666 | * |
669 | 667 | * @return bool |
670 | 668 | */ |
671 | | -function group_tools_group_mail_members_enabled(\ElggGroup $group = null): bool { |
| 669 | +function group_tools_group_mail_members_enabled(?\ElggGroup $group = null): bool { |
672 | 670 | static $mail_members_enabled; |
673 | 671 |
|
674 | 672 | if (!isset($mail_members_enabled)) { |
@@ -713,7 +711,7 @@ function group_tools_group_mail_members_enabled(\ElggGroup $group = null): bool |
713 | 711 | * |
714 | 712 | * @return null|StaleInfo |
715 | 713 | */ |
716 | | -function group_tools_get_stale_info(ElggGroup $group, int $number_of_days = null): ?StaleInfo { |
| 714 | +function group_tools_get_stale_info(ElggGroup $group, ?int $number_of_days = null): ?StaleInfo { |
717 | 715 | if (!isset($number_of_days)) { |
718 | 716 | $number_of_days = (int) elgg_get_plugin_setting('stale_timeout', 'group_tools'); |
719 | 717 | } |
|
0 commit comments