From 89712cf26fe49e446c49eba912d9961744243b9c Mon Sep 17 00:00:00 2001
From: effulgentsia <alex.bronstein@acquia.com>
Date: Mon, 18 Apr 2016 10:25:44 -0700
Subject: [PATCH] Issue #2706669 by alexpott, tstoeckler: Fix
 Drupal.Functions.FunctionDeclaration.* coding standards in core

---
 .../lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php | 2 +-
 core/lib/Drupal/Core/Template/Attribute.php                     | 2 +-
 .../breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php     | 2 +-
 core/modules/node/src/Tests/NodeCreationTest.php                | 2 +-
 .../views/src/Plugin/views/display/DisplayPluginBase.php        | 2 +-
 core/phpcs.xml.dist                                             | 2 ++
 6 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
index c3cef7c8bf25..b1f6abd234c2 100644
--- a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
+++ b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
@@ -52,7 +52,7 @@ class DefaultHtmlRouteProvider implements EntityRouteProviderInterface, EntityHa
    * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
    *   The entity field manager.
    */
-  public function  __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager) {
+  public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager) {
     $this->entityTypeManager = $entity_type_manager;
     $this->entityFieldManager = $entity_field_manager;
   }
diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php
index 8ea227c04e8c..945c5bc0d62c 100644
--- a/core/lib/Drupal/Core/Template/Attribute.php
+++ b/core/lib/Drupal/Core/Template/Attribute.php
@@ -312,7 +312,7 @@ public function toArray() {
   /**
    * Implements the magic __clone() method.
    */
-  public function  __clone() {
+  public function __clone() {
     foreach ($this->storage as $name => $value) {
       $this->storage[$name] = clone $value;
     }
diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
index 04ff9c4941af..7683ea1f668b 100644
--- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
+++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
@@ -91,7 +91,7 @@ public function testThemeBreakpoints() {
   /**
    * Test the custom breakpoint group provided by a theme and a module.
    */
-  public function testCustomBreakpointGroups () {
+  public function testCustomBreakpointGroups() {
     // Verify the breakpoint group for breakpoint_theme_test.group2 was created.
     $expected_breakpoints = array(
       'breakpoint_theme_test.group2.narrow' => array(
diff --git a/core/modules/node/src/Tests/NodeCreationTest.php b/core/modules/node/src/Tests/NodeCreationTest.php
index 59a0a7b3f5dc..507105636ed6 100644
--- a/core/modules/node/src/Tests/NodeCreationTest.php
+++ b/core/modules/node/src/Tests/NodeCreationTest.php
@@ -164,7 +164,7 @@ public function testAuthorAutocomplete() {
   /**
    * Check node/add when no node types exist.
    */
-  function testNodeAddWithoutContentTypes () {
+  function testNodeAddWithoutContentTypes() {
     $this->drupalGet('node/add');
     $this->assertResponse(200);
     $this->assertNoLinkByHref('/admin/structure/types/add');
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index 0a4cc48b3b81..12eeb7b186f1 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2262,7 +2262,7 @@ public function preExecute() {
   /**
    * {@inheritdoc}
    */
-  public function calculateCacheMetadata () {
+  public function calculateCacheMetadata() {
     $cache_metadata = new CacheableMetadata();
 
     // Iterate over ordinary views plugins.
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 150881c5b002..c2237457af0f 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -20,6 +20,8 @@
   <rule ref="Drupal.ControlStructures.ElseIf"/>
   <rule ref="Drupal.Files.TxtFileLineLength"/>
   <rule ref="Drupal.Functions.DiscouragedFunctions"/>
+  <rule ref="Drupal.Functions.FunctionDeclaration.SpaceAfter"/>
+  <rule ref="Drupal.Functions.FunctionDeclaration.SpaceBeforeParenthesis"/>
   <rule ref="Drupal.InfoFiles.AutoAddedKeys"/>
   <rule ref="Drupal.InfoFiles.ClassFiles"/>
   <rule ref="Drupal.InfoFiles.DuplicateEntry"/>
-- 
GitLab