From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- phpBB/phpbb/notification/manager.php | 2 +- phpBB/phpbb/notification/type/pm.php | 2 +- phpBB/phpbb/notification/type/post.php | 10 +++++----- phpBB/phpbb/notification/type/topic.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/phpbb/notification') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 1cd7e5bc9a..ac6bb3c6da 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -339,7 +339,7 @@ class manager } } - if (!sizeof($notify_users)) + if (!count($notify_users)) { return; } diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index 8fb9172911..c51586afb9 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -99,7 +99,7 @@ class pm extends \phpbb\notification\type\base 'ignore_users' => array(), ), $options); - if (!sizeof($pm['recipients'])) + if (!count($pm['recipients'])) { return array(); } diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 03221e7c7a..254f4c07b3 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -202,9 +202,9 @@ class post extends \phpbb\notification\type\base 'username' => $this->get_data('post_username'), )), $responders); - $responders_cnt = sizeof($responders); + $responders_cnt = count($responders); $responders = $this->trim_user_ary($responders); - $trimmed_responders_cnt = $responders_cnt - sizeof($responders); + $trimmed_responders_cnt = $responders_cnt - count($responders); foreach ($responders as $responder) { @@ -337,7 +337,7 @@ class post extends \phpbb\notification\type\base */ public function trim_user_ary($users) { - if (sizeof($users) > 4) + if (count($users) > 4) { array_splice($users, 3); } @@ -357,7 +357,7 @@ class post extends \phpbb\notification\type\base */ public function pre_create_insert_array($post, $notify_users) { - if (!sizeof($notify_users) || !$this->inherit_read_status) + if (!count($notify_users) || !$this->inherit_read_status) { return array(); } @@ -426,7 +426,7 @@ class post extends \phpbb\notification\type\base // Do not add more than 25 responders, // we trim the username list to "a, b, c and x others" anyway // so there is no use to add all of them anyway. - if (sizeof($responders) > 25) + if (count($responders) > 25) { return array(); } diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 671c34fe96..5c42afa8c8 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -261,7 +261,7 @@ class topic extends \phpbb\notification\type\base */ public function pre_create_insert_array($post, $notify_users) { - if (!sizeof($notify_users) || !$this->inherit_read_status) + if (!count($notify_users) || !$this->inherit_read_status) { return array(); } -- cgit v1.2.1