Fix the PHP_CodeSniffer issues reported by GitLab CI

Created on 22 June 2023, over 1 year ago
Updated 19 March 2024, 8 months ago

GitLab CI shows the following PHP_CodeSniffer warnings/errors, which should be fixed.

FILE: ...ect/display_fields/web/modules/custom/display_fields/src/DisplayFields.php
--------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
 13 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 37 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 58 | ERROR | [x] There must be exactly one blank line before the tags in a doc
    |       |     comment (Drupal.Commenting.DocComment.SpacingBeforeTags)
 58 | ERROR | [ ] Missing parameter comment
    |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 58 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 59 | ERROR | [ ] Missing parameter comment
    |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 59 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 60 | ERROR | [ ] Missing parameter comment
    |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 60 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 62 | ERROR | [ ] Return type missing for @return tag in function comment
    |       |     (Drupal.Commenting.FunctionComment.MissingReturnType)
 62 | ERROR | [ ] Description for the @return value is missing
    |       |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 78 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 80 | ERROR | [ ] Missing parameter type
    |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...les/custom/display_fields/src/Plugin/DisplayFieldsField/FieldReference.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
  14 | ERROR   | [x] Doc comment long description must end with a full stop
     |         |     (Drupal.Commenting.DocComment.LongFullStop)
  57 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 222 | WARNING | [x] There must be no blank line following an inline comment
     |         |     (Drupal.Commenting.InlineComment.SpacingAfter)
 222 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...es/custom/display_fields/src/Plugin/DisplayFieldsField/FieldExtraField.php
--------------------------------------------------------------------------------
FOUND 20 ERRORS AND 1 WARNING AFFECTING 17 LINES
--------------------------------------------------------------------------------
 136 | ERROR   | [x] Array indentation error, expected 12 spaces but found 10
     |         |     (Drupal.Arrays.Array.ArrayIndentation)
 175 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
     |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 175 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 175 | ERROR   | [ ] Missing parameter type
     |         |     (Drupal.Commenting.FunctionComment.MissingParamType)
 176 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 177 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 177 | ERROR   | [ ] Missing parameter type
     |         |     (Drupal.Commenting.FunctionComment.MissingParamType)
 179 | ERROR   | [ ] Description for the @return value is missing
     |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 373 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
     |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 373 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 374 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 375 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 376 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 377 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 378 | ERROR   | [ ] Missing parameter comment
     |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 380 | ERROR   | [ ] Description for the @return value is missing
     |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 384 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 390 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
     |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 397 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible (Drupal.Semantics.FunctionT.NotLiteralString)
 411 | ERROR   | [x] Whitespace found at end of line
     |         |     (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
 412 | ERROR   | [ ] Description for the @return value is missing
     |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...les/custom/display_fields/src/Plugin/DisplayFieldsField/FieldEmbedView.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AFFECTING 17 LINES
--------------------------------------------------------------------------------
  43 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
  44 | ERROR | [ ] Description for the @return value is missing
     |       |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 116 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 121 | ERROR | [x] Missing function doc comment
     |       |     (Drupal.Commenting.FunctionComment.Missing)
 381 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
 382 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 383 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 384 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 384 | ERROR | [ ] Missing parameter type
     |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 385 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 385 | ERROR | [ ] Missing parameter type
     |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 459 | ERROR | [ ] Missing short description in doc comment
     |       |     (Drupal.Commenting.DocComment.MissingShort)
 460 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 461 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 462 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 462 | ERROR | [ ] Missing parameter type
     |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 463 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 463 | ERROR | [ ] Missing parameter type
     |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 504 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
     |       |     (Drupal.Arrays.Array.ArrayIndentation)
 505 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
     |       |     (Drupal.Arrays.Array.ArrayIndentation)
 506 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
     |       |     (Drupal.Arrays.Array.ArrayIndentation)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: .../web/modules/custom/display_fields/src/Plugin/DisplayFieldsField/Field.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 180 | ERROR | Long array syntax must not be used in doc comment code
     |       | annotations
     |       | (Drupal.Commenting.DocCommentLongArraySyntax.DocLongArray)
 181 | ERROR | Long array syntax must not be used in doc comment code
     |       | annotations
     |       | (Drupal.Commenting.DocCommentLongArraySyntax.DocLongArray)
--------------------------------------------------------------------------------
FILE: ...splay_fields/src/Plugin/DisplayFieldsField/DisplayFieldsFieldInterface.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 43 | ERROR | Missing parameter comment
    |       | (Drupal.Commenting.FunctionComment.MissingParamComment)
 61 | ERROR | Missing parameter comment
    |       | (Drupal.Commenting.FunctionComment.MissingParamComment)
 62 | ERROR | Missing parameter type
    |       | (Drupal.Commenting.FunctionComment.MissingParamType)
 78 | ERROR | Missing parameter comment
    |       | (Drupal.Commenting.FunctionComment.MissingParamComment)
--------------------------------------------------------------------------------
FILE: ...fields/web/modules/custom/display_fields/src/Element/EntityFieldSelect.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
  54 | ERROR | [ ] Missing member variable doc comment
     |       |     (Drupal.Commenting.VariableComment.Missing)
  56 | ERROR | [ ] Missing member variable doc comment
     |       |     (Drupal.Commenting.VariableComment.Missing)
 186 | ERROR | [ ] Public method name "EntityFieldSelect::getElementHTMLId" is
     |       |     not in lowerCamel format
     |       |     (Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps)
 186 | ERROR | [x] Missing function doc comment
     |       |     (Drupal.Commenting.FunctionComment.Missing)
 352 | ERROR | [x] There must be exactly one blank line before the tags in a
     |       |     doc comment (Drupal.Commenting.DocComment.SpacingBeforeTags)
 364 | ERROR | [x] There must be exactly one blank line before the tags in a
     |       |     doc comment (Drupal.Commenting.DocComment.SpacingBeforeTags)
 364 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ds/web/modules/custom/display_fields/src/Annotation/DisplayFieldsField.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 26 | ERROR | The @var tag must be the first tag in a member variable comment
    |       | (Drupal.Commenting.VariableComment.VarOrder)
--------------------------------------------------------------------------------
FILE: ...lds/web/modules/custom/display_fields/includes/display_fields.field_ui.inc
--------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
  24 | ERROR | [ ] Doc comment short description must be on a single line,
     |       |     further text should be a separate paragraph
     |       |     (Drupal.Commenting.DocComment.ShortSingleLine)
  37 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
  55 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
  56 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 237 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 237 | ERROR | [ ] Missing parameter type
     |       |     (Drupal.Commenting.FunctionComment.MissingParamType)
 238 | ERROR | [ ] Missing parameter comment
     |       |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 258 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 283 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 291 | ERROR | [ ] Doc comment short description must be on a single line,
     |       |     further text should be a separate paragraph
     |       |     (Drupal.Commenting.DocComment.ShortSingleLine)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ect/display_fields/web/modules/custom/display_fields/display_fields.module
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 22 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
    |       |     question marks, colons, or closing parentheses
    |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 70 | ERROR | [ ] Long array syntax must not be used in doc comment code
    |       |     annotations
    |       |     (Drupal.Commenting.DocCommentLongArraySyntax.DocLongArray)
 72 | ERROR | [ ] Long array syntax must not be used in doc comment code
    |       |     annotations
    |       |     (Drupal.Commenting.DocCommentLongArraySyntax.DocLongArray)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 409ms; Memory: 8MB

 
 

📌 Task
Status

Postponed

Version

9.1

Component

Code

Created by

🇮🇳India arti_parmar

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024