[ticket/12721] Add Squiz.ControlStructures.ElseIfDeclaration in legacy

PHPBB3-12721
This commit is contained in:
Tristan Darricau 2014-06-15 21:34:02 +02:00
parent 06bf864c41
commit 09fc008e62
10 changed files with 14 additions and 10 deletions

View file

@ -45,6 +45,9 @@
<!-- When referencing arrays you should not put whitespace around the opening bracket or before the closing bracket. --> <!-- When referencing arrays you should not put whitespace around the opening bracket or before the closing bracket. -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing" /> <rule ref="Squiz.Arrays.ArrayBracketSpacing" />
<!-- Verifies that there are not elseif statements. The else and the if should be separated by a space. -->
<rule ref="Squiz.ControlStructures.ElseIfDeclaration" />
<!-- In the argument list, there MUST NOT be a space before each comma, <!-- In the argument list, there MUST NOT be a space before each comma,
and there MUST be one space after each comma. --> and there MUST be one space after each comma. -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">

View file

@ -496,11 +496,11 @@ function mcp_move_topic($topic_ids)
{ {
$topics_moved++; $topics_moved++;
} }
elseif ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE) else if ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE)
{ {
$topics_moved_unapproved++; $topics_moved_unapproved++;
} }
elseif ($topic_info['topic_visibility'] == ITEM_DELETED) else if ($topic_info['topic_visibility'] == ITEM_DELETED)
{ {
$topics_moved_softdeleted++; $topics_moved_softdeleted++;
} }

View file

@ -489,7 +489,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
{ {
$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports'); $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
} }
elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
{ {
$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports'); $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
} }

View file

@ -1,4 +1,5 @@
<?php <?php
// @codingStandardsIgnoreFile
// //
// $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $ // $Id: sphinxapi.php 3087 2012-01-30 23:07:35Z shodan $

View file

@ -53,7 +53,7 @@ class provider_collection extends \phpbb\di\service_collection
return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method']))); return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method'])));
} }
// Revert to db auth provider if selected method does not exist // Revert to db auth provider if selected method does not exist
elseif ($this->offsetExists('auth.provider.db')) else if ($this->offsetExists('auth.provider.db'))
{ {
return $this->offsetGet('auth.provider.db'); return $this->offsetGet('auth.provider.db');
} }

View file

@ -72,7 +72,7 @@ class upload extends \phpbb\avatar\driver\driver
{ {
$file = $upload->form_upload('avatar_upload_file'); $file = $upload->form_upload('avatar_upload_file');
} }
elseif (!empty($this->config['allow_avatar_remote_upload']) && !empty($url)) else if (!empty($this->config['allow_avatar_remote_upload']) && !empty($url))
{ {
if (!preg_match('#^(http|https|ftp)://#i', $url)) if (!preg_match('#^(http|https|ftp)://#i', $url))
{ {

View file

@ -224,7 +224,7 @@ class file extends \phpbb\cache\driver\base
{ {
$this->remove_dir($fileInfo->getPathname()); $this->remove_dir($fileInfo->getPathname());
} }
elseif (strpos($filename, 'container_') === 0 || else if (strpos($filename, 'container_') === 0 ||
strpos($filename, 'url_matcher') === 0 || strpos($filename, 'url_matcher') === 0 ||
strpos($filename, 'sql_') === 0 || strpos($filename, 'sql_') === 0 ||
strpos($filename, 'data_') === 0) strpos($filename, 'data_') === 0)

View file

@ -60,7 +60,7 @@ class get extends command
{ {
$output->write($this->config[$key]); $output->write($this->config[$key]);
} }
elseif (isset($this->config[$key])) else if (isset($this->config[$key]))
{ {
$output->writeln($this->config[$key]); $output->writeln($this->config[$key]);
} }

View file

@ -60,7 +60,7 @@ class helper
$data[$type] .= ($data[$type] !== '$') ? '\\' : ''; $data[$type] .= ($data[$type] !== '$') ? '\\' : '';
$data[$type] .= str_replace('$', '', $value); $data[$type] .= str_replace('$', '', $value);
} }
elseif ($type == 'settings') else if ($type == 'settings')
{ {
$data[$type] .= ($data[$type] !== '$') ? '$' : ''; $data[$type] .= ($data[$type] !== '$') ? '$' : '';
$data[$type] .= $value; $data[$type] .= $value;

View file

@ -263,12 +263,12 @@ class fulltext_postgres extends \phpbb\search\base
$this->search_query .= $word . ' '; $this->search_query .= $word . ' ';
$this->tsearch_query .= '&' . substr($word, 1) . ' '; $this->tsearch_query .= '&' . substr($word, 1) . ' ';
} }
elseif (strpos($word, '-') === 0) else if (strpos($word, '-') === 0)
{ {
$this->search_query .= $word . ' '; $this->search_query .= $word . ' ';
$this->tsearch_query .= '&!' . substr($word, 1) . ' '; $this->tsearch_query .= '&!' . substr($word, 1) . ' ';
} }
elseif (strpos($word, '|') === 0) else if (strpos($word, '|') === 0)
{ {
$this->search_query .= $word . ' '; $this->search_query .= $word . ' ';
$this->tsearch_query .= '|' . substr($word, 1) . ' '; $this->tsearch_query .= '|' . substr($word, 1) . ' ';