1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

[ticket/14972] replace all occurrences of sizeof() with the count()

PHPBB3-14972
This commit is contained in:
rxu
2017-06-28 00:58:03 +07:00
parent 67a65e3788
commit 797234e416
165 changed files with 986 additions and 986 deletions

View File

@@ -133,7 +133,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
}
// Remove old entries from styles table
if (!sizeof($valid_styles))
if (!count($valid_styles))
{
// No valid styles: remove everything and add prosilver
$this->sql_query('DELETE FROM ' . STYLES_TABLE);

View File

@@ -93,13 +93,13 @@ class teampage extends \phpbb\db\migration\migration
$teampage_entries[] = array(
'group_id' => (int) $row['group_id'],
'teampage_name' => '',
'teampage_position' => sizeof($teampage_entries) + 1,
'teampage_position' => count($teampage_entries) + 1,
'teampage_parent' => 0,
);
}
$this->db->sql_freeresult($result);
if (sizeof($teampage_entries))
if (count($teampage_entries))
{
$this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries);
}

View File

@@ -134,7 +134,7 @@ class config implements \phpbb\db\migration\tool\tool_interface
case 'remove':
$call = 'add';
if (sizeof($arguments) == 1)
if (count($arguments) == 1)
{
$arguments[] = '';
}

View File

@@ -110,7 +110,7 @@ class config_text implements \phpbb\db\migration\tool\tool_interface
case 'remove':
$call = 'add';
if (sizeof($arguments) == 1)
if (count($arguments) == 1)
{
$arguments[] = '';
}

View File

@@ -469,7 +469,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
$parent_id = $parent_id ?: 0;
// If automatic adding is in action, convert array back to string to simplify things
if (is_array($data) && sizeof($data) == 1)
if (is_array($data) && count($data) == 1)
{
$data = $data['module_langname'];
}
@@ -482,7 +482,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
// Search for the parent module_langname
$ids = array_keys($this->module_categories, $parent_id);
switch (sizeof($ids))
switch (count($ids))
{
// No parent with the given module_langname exist
case 0:

View File

@@ -442,7 +442,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface
}
);
if (sizeof($auth_option))
if (count($auth_option))
{
return $this->permission_set($role_name, $auth_option, 'role', $has_permission);
}