Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml shows the following warnings/errors which should be fixed.

FILE: ./awssdk.install
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
 1 | ERROR   | [x] The PHP open tag must be followed by exactly one
   |         |     blank line
 6 | WARNING | [ ] @author tags are not usually used in Drupal,
   |         |     because over time multiple contributors will touch
   |         |     the code anyway
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ./awssdk.module
----------------------------------------------------------------------
FOUND 5 ERRORS AND 6 WARNINGS AFFECTING 10 LINES
----------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one
     |         |     blank line
   6 | WARNING | [ ] @author tags are not usually used in Drupal,
     |         |     because over time multiple contributors will
     |         |     touch the code anyway
  15 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
     |         |     Implements hook_foo_BAR_ID_bar() for
     |         |     xyz_bar().",, "* Implements
     |         |     hook_foo_BAR_ID_bar() for xyz-bar.html.twig.",
     |         |     "* Implements hook_foo_BAR_ID_bar() for
     |         |     xyz-bar.tpl.php.", or "* Implements
     |         |     hook_foo_BAR_ID_bar() for block templates."
  36 | WARNING | [x] A comma should follow the last multiline array
     |         |     item. Found: )
  43 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
     |         |     Implements hook_foo_BAR_ID_bar() for
     |         |     xyz_bar().",, "* Implements
     |         |     hook_foo_BAR_ID_bar() for xyz-bar.html.twig.",
     |         |     "* Implements hook_foo_BAR_ID_bar() for
     |         |     xyz-bar.tpl.php.", or "* Implements
     |         |     hook_foo_BAR_ID_bar() for block templates."
  45 | ERROR   | [ ] awssdk_requirements() is an installation hook
     |         |     and must be declared in an install file
  63 | ERROR   | [x] Use "elseif" in place of "else if"
  63 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  72 | WARNING | [ ] Unused global variable $base_url.
 103 | ERROR   | [ ] Return type missing for @return tag in function
     |         |     comment
 159 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
     |         |     Implements hook_foo_BAR_ID_bar() for
     |         |     xyz_bar().",, "* Implements
     |         |     hook_foo_BAR_ID_bar() for xyz-bar.html.twig.",
     |         |     "* Implements hook_foo_BAR_ID_bar() for
     |         |     xyz-bar.tpl.php.", or "* Implements
     |         |     hook_foo_BAR_ID_bar() for block templates."
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ./awssdk.test
----------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one
    |         |     blank line
  6 | WARNING | [ ] @author tags are not usually used in Drupal,
    |         |     because over time multiple contributors will
    |         |     touch the code anyway
  9 | ERROR   | [x] Missing class doc comment
 10 | ERROR   | [x] Missing function doc comment
 10 | ERROR   | [x] Expected 1 blank line before function; 0 found
 21 | ERROR   | [x] Visibility must be declared on method
    |         |     "testLibrary"
 49 | ERROR   | [x] Expected 1 blank line after function; 0 found
 50 | ERROR   | [x] The closing brace for the class must have an
    |         |     empty line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ./ui/awssdk_ui.info
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 7 | ERROR | Declared file was not found
----------------------------------------------------------------------


FILE: ./ui/awssdk_ui.module
----------------------------------------------------------------------
FOUND 2 ERRORS AND 14 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one
     |         |     blank line
   6 | WARNING | [ ] @author tags are not usually used in Drupal,
     |         |     because over time multiple contributors will
     |         |     touch the code anyway
   7 | WARNING | [ ] @author tags are not usually used in Drupal,
     |         |     because over time multiple contributors will
     |         |     touch the code anyway
  32 | ERROR   | [x] Expected 1 space after "=>"; 2 found
  51 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_key"
  58 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_secret"
  65 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found
     |         |     "aws_certificate_authority"
  66 | WARNING | [ ] Avoid backslash escaping in translatable strings
     |         |     when possible, use "" quotes instead
  71 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_default_cache_config"
  85 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_account_id"
  91 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_canonical_id"
  97 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_canonical_name"
 104 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_mfa_serial"
 105 | WARNING | [ ] Avoid backslash escaping in translatable strings
     |         |     when possible, use "" quotes instead
 110 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_cloudfront_keypair"
 116 | WARNING | [ ] All variables defined by your module must be
     |         |     prefixed with your module's name to avoid name
     |         |     collisions with others. Expected start with
     |         |     "awssdk_ui" but found "aws_cloudfront_pem"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 128ms; Memory: 6MB

Issue fork awssdk-2745157

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aburke626 created an issue. See original summary.

aburke626’s picture

StatusFileSize
new8.58 KB

Patch fixes code standards issues.

aburke626’s picture

Status: Active » Needs review
nikolay shapovalov’s picture

Assigned: aburke626 » Unassigned
avpaderno’s picture

Title: Code Standards Cleanup » Fix the errors/warnings reported by PHP_CodeSniffer
Priority: Normal » Minor
Issue summary: View changes