Skip to content

Commit 250d8d6

Browse files
committed
fixed: PHP implicit null declaration
1 parent a5b7e1f commit 250d8d6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/functions.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
*/
55

66
use ColdTrick\GroupTools\StaleInfo;
7-
use Elgg\Database\AccessCollections;
87
use Elgg\Database\Clauses\OrderByClause;
98
use Elgg\Database\MetadataTable;
10-
use Elgg\Database\RelationshipsTable;
11-
use Elgg\Database\Select;
129
use Elgg\Database\QueryBuilder;
10+
use Elgg\Database\RelationshipsTable;
1311
use Elgg\Security\Base64Url;
1412

1513
/**
@@ -249,7 +247,7 @@ function group_tools_get_invited_groups_by_email(string $email): array {
249247
* @return \ElggGroup[]
250248
* @todo revisit this
251249
*/
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 {
253251
if (!$user instanceof \ElggUser) {
254252
$user = elgg_get_logged_in_user_entity();
255253
}
@@ -379,7 +377,7 @@ function (QueryBuilder $qb, $main_alias) {
379377
*
380378
* @return bool true if the domain of the user is found in the group settings
381379
*/
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 {
383381
if (elgg_get_plugin_setting('domain_based', 'group_tools') !== 'yes') {
384382
return false;
385383
}
@@ -579,7 +577,7 @@ function group_tools_can_assign_group_admin(\ElggGroup $group): bool {
579577
*
580578
* @return bool
581579
*/
582-
function group_tools_join_motivation_required(\ElggGroup $group = null): bool {
580+
function group_tools_join_motivation_required(?\ElggGroup $group = null): bool {
583581
static $plugin_settings;
584582
static $check_group = false;
585583

@@ -632,7 +630,7 @@ function group_tools_join_motivation_required(\ElggGroup $group = null): bool {
632630
*
633631
* @return bool
634632
*/
635-
function group_tools_group_mail_enabled(ElggGroup $group = null): bool {
633+
function group_tools_group_mail_enabled(?\ElggGroup $group = null): bool {
636634
static $mail_enabled;
637635

638636
if (!isset($mail_enabled)) {
@@ -668,7 +666,7 @@ function group_tools_group_mail_enabled(ElggGroup $group = null): bool {
668666
*
669667
* @return bool
670668
*/
671-
function group_tools_group_mail_members_enabled(\ElggGroup $group = null): bool {
669+
function group_tools_group_mail_members_enabled(?\ElggGroup $group = null): bool {
672670
static $mail_members_enabled;
673671

674672
if (!isset($mail_members_enabled)) {
@@ -713,7 +711,7 @@ function group_tools_group_mail_members_enabled(\ElggGroup $group = null): bool
713711
*
714712
* @return null|StaleInfo
715713
*/
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 {
717715
if (!isset($number_of_days)) {
718716
$number_of_days = (int) elgg_get_plugin_setting('stale_timeout', 'group_tools');
719717
}

0 commit comments

Comments
 (0)