Commit 4d006efc authored by catch's avatar catch

Issue #2901789 by mfernea, andriyun, borisson_: Fix...

Issue #2901789 by mfernea, andriyun, borisson_: Fix 'PEAR.Functions.FunctionCallSignature' coding standard
parent 9188516f
...@@ -139,7 +139,7 @@ public function testPersonalContactAccess() { ...@@ -139,7 +139,7 @@ public function testPersonalContactAccess() {
$this->drupalGet('user/' . $this->contactUser->id()); $this->drupalGet('user/' . $this->contactUser->id());
$contact_link = '/user/' . $this->contactUser->id() . '/contact'; $contact_link = '/user/' . $this->contactUser->id() . '/contact';
$this->assertResponse(200); $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. // Restore original email address.
$this->contactUser->setEmail($original_email)->save(); $this->contactUser->setEmail($original_email)->save();
......
...@@ -99,7 +99,7 @@ public function processItem($data) { ...@@ -99,7 +99,7 @@ public function processItem($data) {
} }
else { else {
$batch_context = $args[$last]; $batch_context = $args[$last];
unset ($args[$last]); unset($args[$last]);
} }
$args = array_merge($args, [&$batch_context]); $args = array_merge($args, [&$batch_context]);
......
...@@ -44,7 +44,7 @@ protected function setUp() { ...@@ -44,7 +44,7 @@ protected function setUp() {
->save(); ->save();
// Log in a user who can create 'page' nodes. // Log in a user who can create 'page' nodes.
$this->drupalLogin ($this->drupalCreateUser(['create page content'])); $this->drupalLogin($this->drupalCreateUser(['create page content']));
} }
/** /**
......
...@@ -28,7 +28,7 @@ class StorageTest extends WebTestBase { ...@@ -28,7 +28,7 @@ class StorageTest extends WebTestBase {
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->drupalLogin ($this->drupalCreateUser()); $this->drupalLogin($this->drupalCreateUser());
} }
/** /**
......
...@@ -30,7 +30,7 @@ protected function setUp() { ...@@ -30,7 +30,7 @@ protected function setUp() {
parent::setUp(); parent::setUp();
// Create admin user, log in admin user, and create one node. // Create admin user, log in admin user, and create one node.
$this->drupalLogin ($this->drupalCreateUser([ $this->drupalLogin($this->drupalCreateUser([
'access content', 'access content',
'administer site configuration', 'administer site configuration',
])); ]));
......
...@@ -13,7 +13,7 @@ class ConfigTest extends BrowserTestBase { ...@@ -13,7 +13,7 @@ class ConfigTest extends BrowserTestBase {
protected function setUp(){ protected function setUp(){
parent::setUp(); parent::setUp();
$this->drupalLogin ($this->drupalCreateUser(['administer site configuration'])); $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
} }
/** /**
......
...@@ -25,7 +25,7 @@ protected function setUp() { ...@@ -25,7 +25,7 @@ protected function setUp() {
parent::setUp(); parent::setUp();
// Create admin user and log in admin user. // Create admin user and log in admin user.
$this->drupalLogin ($this->drupalCreateUser([ $this->drupalLogin($this->drupalCreateUser([
'administer site configuration', 'administer site configuration',
'administer content types', 'administer content types',
'administer nodes', 'administer nodes',
......
...@@ -22,7 +22,7 @@ protected function setUp() { ...@@ -22,7 +22,7 @@ protected function setUp() {
parent::setUp(); parent::setUp();
// Create an administrator user. // Create an administrator user.
$this->drupalLogin ($this->drupalCreateUser(['administer software updates'])); $this->drupalLogin($this->drupalCreateUser(['administer software updates']));
} }
/** /**
......
...@@ -242,8 +242,7 @@ public function testRevisionTableWithoutDataTable() { ...@@ -242,8 +242,7 @@ public function testRevisionTableWithoutDataTable() {
->set('revision_table', 'entity_test_mulrev_revision') ->set('revision_table', 'entity_test_mulrev_revision')
->set('revision_data_table', NULL) ->set('revision_data_table', NULL)
->set('id', 'entity_test_mulrev') ->set('id', 'entity_test_mulrev')
->setKey('revision', 'revision_id') ->setKey('revision', 'revision_id');
;
$this->viewsData->setEntityType($entity_type); $this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData(); $data = $this->viewsData->getViewsData();
...@@ -278,8 +277,7 @@ public function testRevisionTableWithRevisionDataTableAndDataTable() { ...@@ -278,8 +277,7 @@ public function testRevisionTableWithRevisionDataTableAndDataTable() {
->set('revision_data_table', 'entity_test_mulrev_property_revision') ->set('revision_data_table', 'entity_test_mulrev_property_revision')
->set('id', 'entity_test_mulrev') ->set('id', 'entity_test_mulrev')
->set('translatable', TRUE) ->set('translatable', TRUE)
->setKey('revision', 'revision_id') ->setKey('revision', 'revision_id');
;
$this->viewsData->setEntityType($entity_type); $this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData(); $data = $this->viewsData->getViewsData();
...@@ -326,8 +324,7 @@ public function testRevisionTableWithRevisionDataTable() { ...@@ -326,8 +324,7 @@ public function testRevisionTableWithRevisionDataTable() {
->set('revision_data_table', 'entity_test_mulrev_property_revision') ->set('revision_data_table', 'entity_test_mulrev_property_revision')
->set('id', 'entity_test_mulrev') ->set('id', 'entity_test_mulrev')
->set('translatable', TRUE) ->set('translatable', TRUE)
->setKey('revision', 'revision_id') ->setKey('revision', 'revision_id');
;
$this->viewsData->setEntityType($entity_type); $this->viewsData->setEntityType($entity_type);
$data = $this->viewsData->getViewsData(); $data = $this->viewsData->getViewsData();
...@@ -560,8 +557,7 @@ public function testDataTableFields() { ...@@ -560,8 +557,7 @@ public function testDataTableFields() {
->set('data_table', 'entity_test_mul_property_data') ->set('data_table', 'entity_test_mul_property_data')
->set('base_table', 'entity_test_mul') ->set('base_table', 'entity_test_mul')
->set('id', '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 = $this->setupBaseFields(EntityTestMul::baseFieldDefinitions($this->baseEntityType));
$base_field_definitions['type'] = BaseFieldDefinition::create('entity_reference') $base_field_definitions['type'] = BaseFieldDefinition::create('entity_reference')
->setLabel('entity test type') ->setLabel('entity test type')
......
...@@ -155,6 +155,32 @@ ...@@ -155,6 +155,32 @@
</rule> </rule>
<rule ref="PEAR.Functions.ValidDefaultValue"/> <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 --> <!-- PSR-2 sniffs -->
<rule ref="PSR2.Classes.PropertyDeclaration"> <rule ref="PSR2.Classes.PropertyDeclaration">
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> <exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
......
...@@ -583,8 +583,7 @@ protected function registerLinkTemplate($link_template) { ...@@ -583,8 +583,7 @@ protected function registerLinkTemplate($link_template) {
protected function registerBundleInfo($bundle_info) { protected function registerBundleInfo($bundle_info) {
$this->entityTypeBundleInfo $this->entityTypeBundleInfo
->getBundleInfo($this->entityTypeId) ->getBundleInfo($this->entityTypeId)
->willReturn([$this->entityTypeId => $bundle_info]) ->willReturn([$this->entityTypeId => $bundle_info]);
;
} }
} }
......
...@@ -136,8 +136,7 @@ public function providerTestGetAddFormRoute() { ...@@ -136,8 +136,7 @@ public function providerTestGetAddFormRoute() {
'entity_type_id' => 'the_entity_type_id', 'entity_type_id' => 'the_entity_type_id',
'_title_callback' => 'Drupal\Core\Entity\Controller\EntityController::addTitle', '_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()]; $data['no_add_form_no_bundle'] = [clone $route, $entity_type2->reveal()];
$entity_type3 = $this->getEntityType($entity_type2); $entity_type3 = $this->getEntityType($entity_type2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment