Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Part of #2571965: [meta] Fix PHP coding standards in core. Add Drupal.Functions.FunctionDeclaration.SpaceAfter and Drupal.Functions.FunctionDeclaration.SpaceBeforeParenthesis to phpcs.xml.dist and fix reported errors...
FILE: ...core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
55 | ERROR | Expected exactly one space after the function keyword
----------------------------------------------------------------------
FILE: ...sites/drupal8alt.dev/core/lib/Drupal/Core/Template/Attribute.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
315 | ERROR | Expected exactly one space after the function keyword
----------------------------------------------------------------------
FILE: .../modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
94 | ERROR | Space before opening parenthesis of function definition
| | prohibited
----------------------------------------------------------------------
FILE: .../drupal8alt.dev/core/modules/node/src/Tests/NodeCreationTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
167 | ERROR | Space before opening parenthesis of function
| | definition prohibited
----------------------------------------------------------------------
FILE: ...ore/modules/views/src/Plugin/views/display/DisplayPluginBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
2265 | ERROR | Space before opening parenthesis of function
| | definition prohibited
----------------------------------------------------------------------
Proposed resolution
Fix it
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 2706669-2.patch | 3.88 KB | alexpott |
Comments
Comment #2
alexpottComment #3
tstoecklerphpcs passes in HEAD, fails with just the phpcs.xml.dist change (like in IS) and passes with full patch applied. Looks good!
Comment #6
webchickeffulgentsia and I co-reviewed this, and everything looks great. :)
Committed and pushed 8.2.x and cherry-picked to 8.1.x.