Problem/Motivation
In #2248463: Require a blank line after <?php, the community has agreed to adopt the standard that a blank line should be required after <?php
opening tags.
Proposed resolution
Patch core to be compliant with the new rule during the 8.2.x RC phase.
Command to fix core will be something like:
phpcbf -s -p --standard=Drupal --extensions='php,module,inc,install,test,profile' --sniffs='Drupal.WhiteSpace.OpenTagNewline' ./core
The diff will enable the rule in phpcs.xml.dist
and then following that be something like:
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index ec12097..42f8fab 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Functions that need to be loaded on every Drupal request.
diff --git a/core/lib/Drupal/Component/Assertion/Handle.php b/core/lib/Drupal/Component/Assertion/Handle.php
index dd9911e..043d41e 100644
--- a/core/lib/Drupal/Component/Assertion/Handle.php
+++ b/core/lib/Drupal/Component/Assertion/Handle.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains \Drupal\Component\Assertion\Handle.
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index ca0dc3a..1dbc1da 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Allows users to change the color scheme of themes.
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index 053ab4a..8133007 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Attach custom data fields to Drupal entities.
diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php
index 316cbfc..ae24d98 100644
--- a/core/modules/migrate/tests/src/Unit/process/GetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains \Drupal\Tests\migrate\Unit\process\GetTest.
diff --git a/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.module b/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.module
index cb2a27d..c7d9624 100644
--- a/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.module
+++ b/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.module
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Test module setting up two tests, one for checking if the entity $langcode is
diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install
index d30cb3b..b9aab3c 100644
--- a/core/profiles/minimal/minimal.install
+++ b/core/profiles/minimal/minimal.install
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Install, update and uninstall functions for the minimal installation profile.
diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install
index 841c10b..0a40ce6 100644
--- a/core/profiles/standard/standard.install
+++ b/core/profiles/standard/standard.install
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Install, update and uninstall functions for the standard installation profile.
diff --git a/core/profiles/standard/standard.profile b/core/profiles/standard/standard.profile
index 4ea7656..e3fb930 100644
--- a/core/profiles/standard/standard.profile
+++ b/core/profiles/standard/standard.profile
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Enables modules and site configuration for a standard site installation.
diff --git a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
index 6042b6f..1299cd6 100644
--- a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
+++ b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains \Drupal\Tests\Component\Assertion\InspectorTest.
diff --git a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
index cff3415..d802374 100644
--- a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains \Drupal\Tests\Core\Mail\MailManagerTest.
Remaining tasks
- Update core to enable and comply with the rule during the RC phase.
- Tag a coder release that includes the rule. (See also: #2744463: Add phpcs, coder 8.2.8 as --dev requirements for drupal/core)
Comment | File | Size | Author |
---|---|---|---|
#6 | 2755677_6.patch | 3.86 KB | Mile23 |
Comments
Comment #2
xjmComment #3
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #5
xjmWe can start making this patch now; it's soon!
Comment #6
Mile23Easy peasy.
Comment #7
klausiLooks good, I executed phpcs after the patch and did not get any remaining errors for this sniff.
Comment #8
alexpottCommitted and pushed 7125a80 to 8.3.x and 4811877 to 8.2.x. Thanks!