summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-10-10 15:18:34 (GMT)
committerNathaniel Catchpole2017-10-10 15:18:34 (GMT)
commit4d006efcf36d8706f8f2534f1b3e7c8aefa62bb4 (patch)
treea084471fdb0e8316679d06f830064114fdf4dff5
parent9188516f1b75488280e0368d09124ee051388052 (diff)
Issue #2901789 by mfernea, andriyun, borisson_: Fix 'PEAR.Functions.FunctionCallSignature' coding standard
-rw-r--r--core/modules/contact/tests/src/Functional/ContactPersonalTest.php2
-rw-r--r--core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php2
-rw-r--r--core/modules/system/src/Tests/Ajax/MultiFormTest.php2
-rw-r--r--core/modules/system/src/Tests/Form/StorageTest.php2
-rw-r--r--core/modules/system/src/Tests/System/FrontPageTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/File/ConfigTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/DateTimeTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/EntityViewsDataTest.php12
-rw-r--r--core/phpcs.xml.dist26
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php3
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php3
12 files changed, 40 insertions, 20 deletions
diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index 5f6e8e6..8304d7c 100644
--- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -139,7 +139,7 @@ class ContactPersonalTest extends BrowserTestBase {
$this->drupalGet('user/' . $this->contactUser->id());
$contact_link = '/user/' . $this->contactUser->id() . '/contact';
$this->assertResponse(200);
- $this->assertNoLinkByHref ($contact_link, 'The "contact" tab is hidden on profiles for users with no email address');
+ $this->assertNoLinkByHref($contact_link, 'The "contact" tab is hidden on profiles for users with no email address');
// Restore original email address.
$this->contactUser->setEmail($original_email)->save();
diff --git a/core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php b/core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php
index 634ba8d..2d07fab 100644
--- a/core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php
+++ b/core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php
@@ -99,7 +99,7 @@ class LocaleTranslation extends QueueWorkerBase implements ContainerFactoryPlugi
}
else {
$batch_context = $args[$last];
- unset ($args[$last]);
+ unset($args[$last]);
}
$args = array_merge($args, [&$batch_context]);
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index 9ca2a66..96844ed 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
@@ -44,7 +44,7 @@ class MultiFormTest extends AjaxTestBase {
->save();
// Log in a user who can create 'page' nodes.
- $this->drupalLogin ($this->drupalCreateUser(['create page content']));
+ $this->drupalLogin($this->drupalCreateUser(['create page content']));
}
/**
diff --git a/core/modules/system/src/Tests/Form/StorageTest.php b/core/modules/system/src/Tests/Form/StorageTest.php
index 7896b53..a1f7fee 100644
--- a/core/modules/system/src/Tests/Form/StorageTest.php
+++ b/core/modules/system/src/Tests/Form/StorageTest.php
@@ -28,7 +28,7 @@ class StorageTest extends WebTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin ($this->drupalCreateUser());
+ $this->drupalLogin($this->drupalCreateUser());
}
/**
diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php
index 312d0db..e24e90c 100644
--- a/core/modules/system/src/Tests/System/FrontPageTest.php
+++ b/core/modules/system/src/Tests/System/FrontPageTest.php
@@ -30,7 +30,7 @@ class FrontPageTest extends WebTestBase {
parent::setUp();
// Create admin user, log in admin user, and create one node.
- $this->drupalLogin ($this->drupalCreateUser([
+ $this->drupalLogin($this->drupalCreateUser([
'access content',
'administer site configuration',
]));
diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php
index da2003a..f413c38 100644
--- a/core/modules/system/tests/src/Functional/File/ConfigTest.php
+++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php
@@ -13,7 +13,7 @@ class ConfigTest extends BrowserTestBase {
protected function setUp(){
parent::setUp();
- $this->drupalLogin ($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
}
/**
diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index 3d35f96..bdecab5 100644
--- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -25,7 +25,7 @@ class DateTimeTest extends BrowserTestBase {
parent::setUp();
// Create admin user and log in admin user.
- $this->drupalLogin ($this->drupalCreateUser([
+ $this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
'administer content types',
'administer nodes',
diff --git a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
index 8fa81ac..b3f9b31 100644
--- a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
+++ b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
@@ -22,7 +22,7 @@ class SystemAuthorizeTest extends BrowserTestBase {
parent::setUp();
// Create an administrator user.
- $this->drupalLogin ($this->drupalCreateUser(['administer software updates']));
+ $this->drupalLogin($this->drupalCreateUser(['administer software updates']));
}
/**
diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
index db5ce18..5620450 100644
--- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -242,8 +242,7 @@ class EntityViewsDataTest extends UnitTestCase {
->set('revision_table', 'entity_test_mulrev_revision')
->set('revision_data_table', NULL)
->set('id', 'entity_test_mulrev')
- ->setKey('revision', 'revision_id')
- ;
+ ->setKey('revision', 'revision_id');
$this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData();
@@ -278,8 +277,7 @@ class EntityViewsDataTest extends UnitTestCase {
->set('revision_data_table', 'entity_test_mulrev_property_revision')
->set('id', 'entity_test_mulrev')
->set('translatable', TRUE)
- ->setKey('revision', 'revision_id')
- ;
+ ->setKey('revision', 'revision_id');
$this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData();
@@ -326,8 +324,7 @@ class EntityViewsDataTest extends UnitTestCase {
->set('revision_data_table', 'entity_test_mulrev_property_revision')
->set('id', 'entity_test_mulrev')
->set('translatable', TRUE)
- ->setKey('revision', 'revision_id')
- ;
+ ->setKey('revision', 'revision_id');
$this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData();
@@ -560,8 +557,7 @@ class EntityViewsDataTest extends UnitTestCase {
->set('data_table', 'entity_test_mul_property_data')
->set('base_table', 'entity_test_mul')
->set('id', 'entity_test_mul')
- ->setKey('bundle', 'type')
- ;
+ ->setKey('bundle', 'type');
$base_field_definitions = $this->setupBaseFields(EntityTestMul::baseFieldDefinitions($this->baseEntityType));
$base_field_definitions['type'] = BaseFieldDefinition::create('entity_reference')
->setLabel('entity test type')
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 3d487e6..e067f90 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -155,6 +155,32 @@
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
+ <!-- PEAR sniffs -->
+ <rule ref="PEAR.Functions.FunctionCallSignature"/>
+ <!-- The sniffs inside PEAR.Functions.FunctionCallSignature silenced below are
+ also silenced in Drupal CS' ruleset.xml. The code below is a 1-on-1 copy
+ from that file. -->
+ <!-- Disable some error messages that we already cover. -->
+ <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
+ <severity>0</severity>
+ </rule>
+ <rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
+ <severity>0</severity>
+ </rule>
+ <!-- Disable some error messages that we do not want. -->
+ <rule ref="PEAR.Functions.FunctionCallSignature.Indent">
+ <severity>0</severity>
+ </rule>
+ <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
+ <severity>0</severity>
+ </rule>
+ <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
+ <severity>0</severity>
+ </rule>
+ <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
+ <severity>0</severity>
+ </rule>
+
<!-- PSR-2 sniffs -->
<rule ref="PSR2.Classes.PropertyDeclaration">
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index 1e9ee7c..cf0f93f 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -583,8 +583,7 @@ class EntityUrlTest extends UnitTestCase {
protected function registerBundleInfo($bundle_info) {
$this->entityTypeBundleInfo
->getBundleInfo($this->entityTypeId)
- ->willReturn([$this->entityTypeId => $bundle_info])
- ;
+ ->willReturn([$this->entityTypeId => $bundle_info]);
}
}
diff --git a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
index 36f58c3..4e25e4e 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
@@ -136,8 +136,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
'entity_type_id' => 'the_entity_type_id',
'_title_callback' => 'Drupal\Core\Entity\Controller\EntityController::addTitle',
])
- ->setRequirement('_entity_create_access', 'the_entity_type_id')
- ;
+ ->setRequirement('_entity_create_access', 'the_entity_type_id');
$data['no_add_form_no_bundle'] = [clone $route, $entity_type2->reveal()];
$entity_type3 = $this->getEntityType($entity_type2);