diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index a033d1da575..5da67fb07ae 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -445,22 +445,22 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
if ($key == 'default_logo') {
$config->set('logo.use_default', $value);
}
- else if ($key == 'logo_path') {
+ elseif ($key == 'logo_path') {
$config->set('logo.path', $value);
}
- else if ($key == 'default_favicon') {
+ elseif ($key == 'default_favicon') {
$config->set('favicon.use_default', $value);
}
- else if ($key == 'favicon_path') {
+ elseif ($key == 'favicon_path') {
$config->set('favicon.path', $value);
}
- else if ($key == 'favicon_mimetype') {
+ elseif ($key == 'favicon_mimetype') {
$config->set('favicon.mimetype', $value);
}
- else if (substr($key, 0, 7) == 'toggle_') {
+ elseif (substr($key, 0, 7) == 'toggle_') {
$config->set('features.' . Unicode::substr($key, 7), $value);
}
- else if (!in_array($key, array('theme', 'logo_upload'))) {
+ elseif (!in_array($key, array('theme', 'logo_upload'))) {
$config->set($key, $value);
}
}
diff --git a/core/lib/Drupal/Core/Config/ConfigBase.php b/core/lib/Drupal/Core/Config/ConfigBase.php
index 0d66c66bd99..8263e9a6228 100644
--- a/core/lib/Drupal/Core/Config/ConfigBase.php
+++ b/core/lib/Drupal/Core/Config/ConfigBase.php
@@ -290,7 +290,7 @@ abstract class ConfigBase implements RefinableCacheableDependencyInterface {
if ($data instanceof MarkupInterface) {
$data = (string) $data;
}
- else if (is_array($data)) {
+ elseif (is_array($data)) {
array_walk_recursive($data, function (&$value) {
if ($value instanceof MarkupInterface) {
$value = (string) $value;
diff --git a/core/lib/Drupal/Core/Datetime/Plugin/Field/FieldWidget/TimestampDatetimeWidget.php b/core/lib/Drupal/Core/Datetime/Plugin/Field/FieldWidget/TimestampDatetimeWidget.php
index 66ac11d84ee..fd64c57a059 100644
--- a/core/lib/Drupal/Core/Datetime/Plugin/Field/FieldWidget/TimestampDatetimeWidget.php
+++ b/core/lib/Drupal/Core/Datetime/Plugin/Field/FieldWidget/TimestampDatetimeWidget.php
@@ -54,7 +54,7 @@ class TimestampDatetimeWidget extends WidgetBase {
if (isset($item['value']) && $item['value'] instanceof DrupalDateTime) {
$date = $item['value'];
}
- else if (isset($item['value']['object']) && $item['value']['object'] instanceof DrupalDateTime) {
+ elseif (isset($item['value']['object']) && $item['value']['object'] instanceof DrupalDateTime) {
$date = $item['value']['object'];
}
else {
diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php
index aad1dcd694f..16eb59a0bb3 100644
--- a/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php
+++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php
@@ -99,10 +99,10 @@ class TaggedHandlersPass implements CompilerPassInterface {
if ($param->getClass()) {
$interface = $param->getClass();
}
- else if ($param->getName() === 'id') {
+ elseif ($param->getName() === 'id') {
$id_pos = $pos;
}
- else if ($param->getName() === 'priority') {
+ elseif ($param->getName() === 'priority') {
$priority_pos = $pos;
}
else {
diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
index 6886bb20f48..a28fc5147ac 100644
--- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
+++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
@@ -52,7 +52,7 @@ class StreamWrapperManager extends ContainerAware implements StreamWrapperManage
if (isset($this->wrappers[$filter])) {
return $this->wrappers[$filter];
}
- else if (isset($this->wrappers[StreamWrapperInterface::ALL])) {
+ elseif (isset($this->wrappers[StreamWrapperInterface::ALL])) {
$this->wrappers[$filter] = array();
foreach ($this->wrappers[StreamWrapperInterface::ALL] as $scheme => $info) {
// Bit-wise filter.
diff --git a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
index 860cc5628ee..05468c1ad2b 100644
--- a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
+++ b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php
@@ -45,7 +45,7 @@ class TwigNodeVisitor extends \Twig_BaseNodeVisitor {
);
}
// Change the 'escape' filter to our own 'drupal_escape' filter.
- else if ($node instanceof \Twig_Node_Expression_Filter) {
+ elseif ($node instanceof \Twig_Node_Expression_Filter) {
$name = $node->getNode('filter')->getAttribute('value');
if ('escape' == $name || 'e' == $name) {
// Use our own escape filter that is SafeMarkup aware.
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index 7419a15d04f..dae2cfd3b28 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -338,19 +338,19 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
continue;
}
// The new filter allows less attributes (all -> list or none).
- else if (!is_array($current_attributes) && $current_attributes == TRUE && ($new_attributes == FALSE || is_array($new_attributes))) {
+ elseif (!is_array($current_attributes) && $current_attributes == TRUE && ($new_attributes == FALSE || is_array($new_attributes))) {
$intersection[$tag] = $new_attributes;
}
// The new filter allows less attributes (list -> none).
- else if (is_array($current_attributes) && $new_attributes == FALSE) {
+ elseif (is_array($current_attributes) && $new_attributes == FALSE) {
$intersection[$tag] = $new_attributes;
}
// The new filter allows more attributes; retain current.
- else if (is_array($current_attributes) && $new_attributes == TRUE) {
+ elseif (is_array($current_attributes) && $new_attributes == TRUE) {
continue;
}
// The new filter allows the same attributes; retain current.
- else if ($current_attributes == $new_attributes) {
+ elseif ($current_attributes == $new_attributes) {
continue;
}
// Both list an array of attribute values; do an intersection,
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index f6667e0ee0d..066afcc953b 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -102,7 +102,7 @@ function shortcut_set_switch_access($account = NULL) {
if (!isset($account)) {
return AccessResult::allowed()->cachePerPermissions();
}
- else if ($user->id() == $account->id()) {
+ elseif ($user->id() == $account->id()) {
return AccessResult::allowed()->cachePerPermissions()->cachePerUser();
}
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 2edfc819781..1e3bfdb0865 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -2970,7 +2970,7 @@ abstract class WebTestBase extends TestBase {
}
// The URL generator service is not necessarily available yet; e.g., in
// interactive installer tests.
- else if ($this->container->has('url_generator')) {
+ elseif ($this->container->has('url_generator')) {
$force_internal = isset($options['external']) && $options['external'] == FALSE;
if (!$force_internal && UrlHelper::isExternal($path)) {
return Url::fromUri($path, $options)->toString();
diff --git a/core/modules/system/src/Tests/Theme/TwigTransTest.php b/core/modules/system/src/Tests/Theme/TwigTransTest.php
index 6bfe4421b30..867c4d5bae2 100644
--- a/core/modules/system/src/Tests/Theme/TwigTransTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php
@@ -256,7 +256,7 @@ msgid "I have context."
msgstr "I HAZ KONTEX."
EOF;
}
- else if ($langcode === 'zz') {
+ elseif ($langcode === 'zz') {
return <<< EOF
msgid ""
msgstr ""
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index fa7658beb8e..afa58923ce6 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -99,18 +99,18 @@ function system_requirements($phase) {
if ($matches[1] < 2) {
$rewrite_error = TRUE;
}
- else if ($matches[1] == 2) {
+ elseif ($matches[1] == 2) {
if (!isset($matches[2])) {
$rewrite_warning = TRUE;
}
- else if ($matches[2] < 2) {
+ elseif ($matches[2] < 2) {
$rewrite_error = TRUE;
}
- else if ($matches[2] == 2) {
+ elseif ($matches[2] == 2) {
if (!isset($matches[3])) {
$rewrite_warning = TRUE;
}
- else if ($matches[3] < 16) {
+ elseif ($matches[3] < 16) {
$rewrite_error = TRUE;
}
}
diff --git a/core/modules/tour/src/Tests/TourTestBase.php b/core/modules/tour/src/Tests/TourTestBase.php
index c6372cde9a1..06a7a08e2bf 100644
--- a/core/modules/tour/src/Tests/TourTestBase.php
+++ b/core/modules/tour/src/Tests/TourTestBase.php
@@ -58,7 +58,7 @@ abstract class TourTestBase extends WebTestBase {
$elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $this->content, TRUE);
$this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', array('%data-id' => $tip['data-id'])));
}
- else if (!empty($tip['data-class'])) {
+ elseif (!empty($tip['data-class'])) {
$elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $this->content, TRUE);
$this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', array('%data-class' => $tip['data-class'])));
}
diff --git a/core/modules/user/src/UserAccessControlHandler.php b/core/modules/user/src/UserAccessControlHandler.php
index 605f7c7d161..ae52b2bc5a8 100644
--- a/core/modules/user/src/UserAccessControlHandler.php
+++ b/core/modules/user/src/UserAccessControlHandler.php
@@ -44,7 +44,7 @@ class UserAccessControlHandler extends EntityAccessControlHandler {
return AccessResult::allowed()->cachePerPermissions()->cacheUntilEntityChanges($entity);
}
// Users can view own profiles at all times.
- else if ($account->id() == $entity->id()) {
+ elseif ($account->id() == $entity->id()) {
return AccessResult::allowed()->cachePerUser();
}
break;
diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php
index b58037ef3db..462d53f7ff6 100644
--- a/core/modules/views/src/Plugin/views/PluginBase.php
+++ b/core/modules/views/src/Plugin/views/PluginBase.php
@@ -250,7 +250,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
$this->unpackOptions($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), $all, FALSE);
}
- else if ($all || !empty($definition[$key])) {
+ elseif ($all || !empty($definition[$key])) {
$storage[$key] = $value;
}
}
diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php
index 5d0ae74a853..3e3482a0262 100644
--- a/core/modules/views/src/Plugin/views/filter/InOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/InOperator.php
@@ -349,7 +349,7 @@ class InOperator extends FilterPluginBase {
if (count($this->value) == 0) {
$values = $this->t('Unknown');
}
- else if (count($this->value) == 1) {
+ elseif (count($this->value) == 1) {
// If any, use the 'single' short name of the operator instead.
if (isset($info[$this->operator]['short_single'])) {
$operator = $info[$this->operator]['short_single'];
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 4015e140719..4d5c950bdc2 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -25,7 +25,6 @@
-
diff --git a/core/scripts/generate-d7-content.sh b/core/scripts/generate-d7-content.sh
index 9925fe1bb9d..8b591f42b03 100644
--- a/core/scripts/generate-d7-content.sh
+++ b/core/scripts/generate-d7-content.sh
@@ -168,10 +168,10 @@ for ($i = 0; $i < 36; $i++) {
if ($i < 12) {
$node->type = 'page';
}
- else if ($i < 24) {
+ elseif ($i < 24) {
$node->type = 'story';
}
- else if (module_exists('blog')) {
+ elseif (module_exists('blog')) {
$node->type = 'blog';
}
$node->sticky = 0;
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index 2c46a0b1df1..287c344d5ce 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -798,7 +798,7 @@ class AccessResultTest extends UnitTestCase {
if ($op === 'OR') {
$result = $first->orIf($second);
}
- else if ($op === 'AND') {
+ elseif ($op === 'AND') {
$result = $first->andIf($second);
}
else {