Fix coding standard related errors

Created on 7 May 2016, about 8 years ago
Updated 27 February 2023, over 1 year ago

When running the module code against Drupal coding standards based on Drupal standard, the module shows errors

phpcs -s --standard=Drupal .

FILE: ...s/default/modules/sweetalert/src/Form/SweetAlertSettingsForm.php
----------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not
    |         |     begin with a file doc comment
    |         |     (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
 13 | ERROR   | [x] Missing class doc comment
    |         |     (Drupal.Commenting.ClassComment.Missing)
 38 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 39 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: ) (Drupal.Array.Array.CommaLastItem)
 51 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: 'Twitter' (Drupal.Array.Array.CommaLastItem)
 68 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    |         |     (Drupal.Files.EndFileNewline.NoneFound)
 68 | ERROR   | [x] The closing brace for the class must have an empty
    |         |     line before it
    |         |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../sites/default/modules/sweetalert/src/Ajax/SweetAlertCommand.php
----------------------------------------------------------------------
FOUND 24 ERRORS AND 2 WARNINGS AFFECTING 20 LINES
----------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not
    |         |     begin with a file doc comment
    |         |     (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
 20 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 27 | WARNING | [ ] Line exceeds 80 characters; contains 88
    |         |     characters (Drupal.Files.LineLength.TooLong)
 27 | ERROR   | [ ] Doc comment short description must be on a single
    |         |     line, further text should be a separate paragraph
    |         |     (Drupal.Commenting.DocComment.ShortSingleLine)
 28 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 28 | ERROR   | [ ] Missing parameter comment
    |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 36 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 36 | ERROR   | [ ] Description for the @return value is missing
    |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 42 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 43 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 44 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 45 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 46 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 47 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 51 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 52 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 53 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 55 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 56 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 57 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 61 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: false (Drupal.Array.Array.CommaLastItem)
 61 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 67 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 67 | ERROR   | [ ] Description for the @return value is missing
    |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 82 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    |         |     (Drupal.Files.EndFileNewline.NoneFound)
 82 | ERROR   | [x] The closing brace for the class must have an empty
    |         |     line before it
    |         |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 21 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ault/modules/sweetalert/tests/src/Unit/SweetAlertCommandTest.php
----------------------------------------------------------------------
FOUND 23 ERRORS AND 3 WARNINGS AFFECTING 20 LINES
----------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not
    |         |     begin with a file doc comment
    |         |     (Drupal.Commenting.FileComment.NamespaceNoFileDoc)
 29 | WARNING | [ ] Line exceeds 80 characters; contains 89
    |         |     characters (Drupal.Files.LineLength.TooLong)
 30 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 30 | ERROR   | [ ] Missing parameter comment
    |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 30 | ERROR   | [ ] Missing parameter type
    |         |     (Drupal.Commenting.FunctionComment.MissingParamType)
 31 | ERROR   | [ ] Missing parameter comment
    |         |     (Drupal.Commenting.FunctionComment.MissingParamComment)
 31 | ERROR   | [ ] Missing parameter type
    |         |     (Drupal.Commenting.FunctionComment.MissingParamType)
 32 | ERROR   | [x] Separate the @param and @dataProvider sections by a
    |         |     blank line.
    |         |     (Drupal.Commenting.DocComment.TagGroupSpacing)
 41 | WARNING | [ ] Line exceeds 80 characters; contains 88
    |         |     characters (Drupal.Files.LineLength.TooLong)
 61 | ERROR   | [x] There must be exactly one blank line before the tags
    |         |     in a doc comment
    |         |     (Drupal.Commenting.DocComment.SpacingBeforeTags)
 61 | ERROR   | [ ] Description for the @return value is missing
    |         |     (Drupal.Commenting.FunctionComment.MissingReturnComment)
 68 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 69 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 70 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 71 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 72 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 76 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 77 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 78 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "NULL" but found "null"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 80 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 81 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 82 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "TRUE" but found "true"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 86 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected
    |         |     "FALSE" but found "false"
    |         |     (Generic.PHP.UpperCaseConstant.Found)
 86 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: ] (Drupal.Array.Array.CommaLastItem)
 89 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    |         |     (Drupal.Files.EndFileNewline.NoneFound)
 89 | ERROR   | [x] The closing brace for the class must have an empty
    |         |     line before it
    |         |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 67ms; Memory: 6Mb
πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States anoopjohn Washington D. C.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024