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.
When running the module code against Drupal coding standards based on Drupal standard, the module shows errors
phpcs -s --standard=Drupal sites/default/modules/block_field/
FILE: ...l/sites/default/modules/block_field/src/Tests/BlockFieldTest.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
19 | ERROR | If the line declaring an array spans longer than 80
| | characters, each element should be broken into its own line
| | (Drupal.Array.Array.LongLineDeclaration)
24 | ERROR | Visibility must be declared on method "testBlockField"
| | (Squiz.Scope.MethodScope.Missing)
----------------------------------------------------------------------
FILE: ...ck_field/src/Plugin/Field/FieldFormatter/BlockFieldFormatter.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...es/block_field/src/Plugin/Field/FieldWidget/BlockFieldWidget.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
10 | WARNING | [x] Unused use statement
| | (Drupal.Classes.UnusedUseStatement.UnusedUse)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...odules/block_field/src/Plugin/Field/FieldType/BlockFieldItem.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
125 | ERROR | [x] Expected 1 blank line after function; 2 found
| | (Squiz.WhiteSpace.FunctionSpacing.After)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...ites/default/modules/block_field/src/BlockFieldItemInterface.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
24 | ERROR | [x] Whitespace found at end of line
| | (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...upal/sites/default/modules/block_field/src/BlockFieldManager.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...s/default/modules/block_field/src/BlockFieldManagerInterface.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
22 | ERROR | [x] Whitespace found at end of line
| | (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...es/block_field_test/src/Plugin/Block/BlockFieldTestTimeBlock.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...block_field_test/src/Plugin/Block/BlockFieldTestContentBlock.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...field_test/src/Plugin/Block/BlockFieldTestAuthenticatedBlock.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
| | (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 132ms; Memory: 6Mb
Comment | File | Size | Author |
---|---|---|---|
#2 | block_field-coding-standard-fixes-2731657-2.patch | 5.5 KB | anoopjohn |
|
Comments
Comment #2
anoopjohn CreditAttribution: anoopjohn at Zyxware Technologies commentedPlease find a patch that fixes the issues.
Comment #3
anoopjohn CreditAttribution: anoopjohn at Zyxware Technologies commentedComment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer commentedSorry but I don't give commit credit for automated code reviews. If you install the module, test it, find some bugs, and create a ticket, I will gladly fix the bug and give you commit credit.
Comment #5
anoopjohn CreditAttribution: anoopjohn at Zyxware Technologies commentedThanks for the quick reply. I am working on the coder module and finding issues and fixing issues in the coder module. As part of that I am reviewing core / modules and fixing issues / reporting issues. You can check this out here.
https://www.drupal.org/project/issues/user?text=anoopjohn&projects=coder...
Please also note that there were violations that were corrected manually.
Comment #6
anoopjohn CreditAttribution: anoopjohn at Zyxware Technologies commentedComment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer commented