Problem/Motivation

Fix all 72 coding standards messages created by PHPCS:

FILE: ...idation/Constraint/RangeFromGreaterToConstraintValidatorTest.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
----------------------------------------------------------------------
 19 | WARNING | [ ] Line exceeds 80 characters; contains 115
    |         |     characters
 29 | ERROR   | [ ] Type hint "\Drupal\range\RangeItemInterface"
    |         |     missing for $value
 34 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
 38 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
 68 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...on/Constraint/RangeBothValuesRequiredConstraintValidatorTest.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
----------------------------------------------------------------------
 19 | WARNING | [ ] Line exceeds 80 characters; contains 120
    |         |     characters
 29 | ERROR   | [ ] Type hint "\Drupal\range\RangeItemInterface"
    |         |     missing for $value
 34 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
 38 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
 74 | ERROR   | [x] Object operator not indented correctly; expected
    |         |     8 spaces but found 10
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...w/html/modules/contrib/range/tests/src/Traits/RangeTestTrait.php
----------------------------------------------------------------------
FOUND 16 ERRORS AND 1 WARNING AFFECTING 17 LINES
----------------------------------------------------------------------
  13 | ERROR   | [ ] Missing short description in doc comment
  18 | ERROR   | [ ] Missing short description in doc comment
  23 | ERROR   | [ ] Missing short description in doc comment
  28 | ERROR   | [ ] Missing short description in doc comment
  33 | ERROR   | [ ] Missing short description in doc comment
  38 | ERROR   | [ ] Missing short description in doc comment
  50 | ERROR   | [x] Parameter comment must end with a full stop
  66 | ERROR   | [x] Parameter comment must end with a full stop
  82 | ERROR   | [x] Parameter comment must end with a full stop
 108 | ERROR   | [x] Parameter comment must end with a full stop
 140 | ERROR   | [x] Parameter comment must end with a full stop
 171 | ERROR   | [x] Object operator not indented correctly; expected
     |         |     8 spaces but found 10
 183 | ERROR   | [x] Parameter comment must end with a full stop
 210 | ERROR   | [x] Object operator not indented correctly; expected
     |         |     8 spaces but found 10
 215 | ERROR   | [ ] Parameter $display_type is not described in
     |         |     comment
 222 | ERROR   | [x] Parameter comment must end with a full stop
 255 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: 'range_float'
----------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...tml/modules/contrib/range/tests/src/Kernel/Widget/WidgetTest.php
----------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------
  19 | ERROR   | [ ] Missing short description in doc comment
  28 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: 'range'
  31 | ERROR   | [ ] Missing short description in doc comment
  36 | ERROR   | [ ] Missing short description in doc comment
  89 | ERROR   | [ ] Protected method name
     |         |     "WidgetTest::constructRangeFieldXPath" is not in
     |         |     lowerCamel format
 122 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
 124 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ontrib/range/tests/src/Kernel/Formatter/IntegerFormatterTest.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
 31 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 33 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 40 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
----------------------------------------------------------------------


FILE: ...s/contrib/range/tests/src/Kernel/Formatter/FormatterTestBase.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------
 17 | ERROR   | [ ] Missing short description in doc comment
 26 | WARNING | [x] A comma should follow the last multiline array
    |         |     item. Found: 'range'
 29 | ERROR   | [ ] Missing short description in doc comment
 34 | ERROR   | [ ] Missing short description in doc comment
 39 | ERROR   | [ ] Missing short description in doc comment
 44 | ERROR   | [ ] Missing short description in doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ontrib/range/tests/src/Kernel/Formatter/DecimalFormatterTest.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
 33 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 34 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 35 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 42 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
 44 | ERROR | If the line declaring an array spans longer than 80
    |       | characters, each element should be broken into its own
    |       | line
----------------------------------------------------------------------


FILE: ...modules/range_test/test_views/views.view.test_argument_range.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 58 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...dules/contrib/range/tests/modules/range_test/range_test.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added
   |         | by drupal.org packaging automatically
----------------------------------------------------------------------


FILE: ...tml/modules/contrib/range/src/Tests/Views/RangeViewsTestBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 42 | ERROR | Class property $field_name should use lowerCamel naming
    |       | without underscores
----------------------------------------------------------------------


FILE: /var/www/html/modules/contrib/range/src/Tests/RangeTestBase.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  42 | ERROR | [x] Parameter comment must end with a full stop
  58 | ERROR | [x] Parameter comment must end with a full stop
  74 | ERROR | [x] Parameter comment must end with a full stop
 100 | ERROR | [x] Parameter comment must end with a full stop
 132 | ERROR | [x] Parameter comment must end with a full stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...tml/modules/contrib/range/src/Tests/RangeFieldValidationTest.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 36 | ERROR | [x] Parameter comment must end with a full stop
 43 | ERROR | [x] Functions must not contain multiple empty lines in
    |       |     a row; found 2 empty lines
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ar/www/html/modules/contrib/range/src/Tests/RangeFieldUITest.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  32 | ERROR | [ ] If the line declaring an array spans longer than
     |       |     80 characters, each element should be broken into
     |       |     its own line
  45 | ERROR | [x] Parameter comment must end with a full stop
  67 | ERROR | [x] Parameter comment must end with a full stop
  89 | ERROR | [x] Parameter comment must end with a full stop
 165 | ERROR | [ ] Public method name
     |       |     "RangeFieldUITest::testRangeFieldsUI" is not in
     |       |     lowerCamel format
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /var/www/html/modules/contrib/range/src/RangeItemInterface.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 22 | ERROR | [x] Visibility must be declared on method
    |       |     "getColumnSpecification"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...w/html/modules/contrib/range/src/Plugin/views/argument/Range.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 78 | ERROR | [x] There should be no white space after an opening "("
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rc/Plugin/Validation/Constraint/RangeFromGreaterToConstraint.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 8 | WARNING | Line exceeds 80 characters; contains 87 characters
----------------------------------------------------------------------


FILE: ...rib/range/src/Plugin/Field/FieldFormatter/RangeFormatterBase.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
 132 | ERROR | [x] Doc comment long description must end with a full
     |       |     stop
 171 | ERROR | [x] Return comment indentation must be 3 spaces, found
     |       |     2 spaces
 185 | ERROR | [x] Expected "bool" but found "boolean" for parameter
     |       |     type
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /var/www/html/modules/contrib/range/range.views.inc
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
  52 | ERROR   | If the line declaring an array spans longer than 80
     |         | characters, each element should be broken into its
     |         | own line
 118 | WARNING | Line exceeds 80 characters; contains 92 characters
----------------------------------------------------------------------


FILE: /var/www/html/modules/contrib/range/range.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added
   |         | by drupal.org packaging automatically
----------------------------------------------------------------------

Remaining tasks

Provide a patch.

User interface changes

No

API changes

No

Comments

Taran2L created an issue. See original summary.

taran2l’s picture

Issue summary: View changes
mylies’s picture

Assigned: Unassigned » mylies
mylies’s picture

Assigned: mylies » Unassigned
Status: Active » Needs review
StatusFileSize
new30.26 KB

I updated the code by code standards, but for some lines I can't do anything
for example - tests/src/Unit/Plugin/Validation/Constraint/RangeFromGreaterToConstraintValidatorTest.php

  /**
   * Tests the \Drupal\range\Plugin\Validation\Constraint\RangeFromGreaterToConstraintValidator::validate() method.
   *

it's to long namespace
or src/Tests/RangeFieldUITest.php
public function testRangeFieldsUI() {
UI - I think it couldn't be Ui
but if someone see better variant - feel free to use this patch source

taran2l’s picture

StatusFileSize
new79.19 KB

Updated patch with some style changes

taran2l’s picture

StatusFileSize
new43.03 KB

Couple more fixes

taran2l’s picture

Status: Needs review » Needs work

Hmmm, 60->52 passes. Something is wrong here

taran2l’s picture

Status: Needs work » Needs review
StatusFileSize
new161.21 KB

Also convert to short array syntax

taran2l’s picture

StatusFileSize
new68.52 KB

Wrong line endings :(

taran2l’s picture

StatusFileSize
new69.28 KB

Let's try one more time

  • Taran2L committed 3f48e19 on 8.x-1.x
    refactor(coding_standards): Fix all coding standards messages (issue #...
taran2l’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.