Some 8.x-1.x-dev coding standard violations remain pending after automating fixing from PHP CodeSniffer and should be fixed manually.

(For those new to Coder Sniffer, see https://www.drupal.org/node/1419988)

Tested with PHP_CodeSniffer version 2.7.1:

FILE: .../modules/contrib/ace_editor/src/Plugin/Filter/AceFilter.php
----------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
----------------------------------------------------------------------
   9 | ERROR   | Missing short description in doc comment
  33 | ERROR   | Doc comment is empty
  40 | WARNING | Line exceeds 80 characters; contains 83 characters
 107 | ERROR   | Inline doc block comments are not allowed; use "/*
     |         | Comment */" or "// Comment" instead
 118 | ERROR   | Doc comment is empty
 180 | ERROR   | Public method name "AceFilter::tag_attributes" is
     |         | not in lowerCamel format
 212 | ERROR   | Public method name "AceFilter::str_replace_once" is
     |         | not in lowerCamel format
----------------------------------------------------------------------


FILE: .../modules/contrib/ace_editor/src/Plugin/Editor/AceEditor.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  41 | ERROR | Type hint "array" missing for $settings
 108 | ERROR | Inline doc block comments are not allowed; use "/*
     |       | Comment */" or "// Comment" instead
 188 | ERROR | Public method name "AceEditor::getJSSettings" is not
     |       | in lowerCamel format
----------------------------------------------------------------------


FILE: ...trib/ace_editor/src/Plugin/Field/FieldFormatter/AceFormatter.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
  22 | ERROR   | Doc comment is empty
  48 | WARNING | Line exceeds 80 characters; contains 83 characters
 115 | ERROR   | Inline doc block comments are not allowed; use "/*
     |         | Comment */" or "// Comment" instead
----------------------------------------------------------------------


FILE: .../modules/contrib/ace_editor/ace_editor.install
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  3 | ERROR | Missing short description in doc comment
 11 | ERROR | Doc comment is empty
----------------------------------------------------------------------


FILE: .../modules/contrib/ace_editor/ace_editor.module
----------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
  8 | ERROR   | Doc comment short description must be on a single
    |         | line, further text should be a separate paragraph
 12 | 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."
 14 | WARNING | Line exceeds 80 characters; contains 98 characters
----------------------------------------------------------------------


Support from Acquia helps fund testing for Drupal Acquia logo

Comments

interdruper created an issue. See original summary.

interdruper’s picture

Title: Satisfy CodeSniffer coding standards » Satisfy PHP CodeSniffer coding standards
ankitjain28may’s picture

I am trying to check for the php_codesniffer error having phpcs V2.8.1 and drupal/coder V8.2.12.
I find only this errors-

FILE: ...trib/ace_editor/src/Plugin/Field/FieldFormatter/AceFormatter.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
----------------------------------------------------------------------
  36 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  50 | WARNING | \Drupal calls should be avoided in classes, use
     |         | dependency injection instead
  55 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  64 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  65 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  74 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  75 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  84 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  85 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  93 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
  94 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
 102 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
 107 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
 112 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
 117 | WARNING | t() calls should be avoided in classes, use
     |         | dependency injection and $this->t() instead
----------------------------------------------------------------------


FILE: ...r/www/html/drupal/modules/contrib/ace_editor/ace_editor.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 7 | WARNING | All dependencies must be prefixed with the project
   |         | name, for example "drupal:"
----------------------------------------------------------------------

Time: 219ms; Memory: 6Mb

Can you review this please so i will fix this up.

ankitjain28may’s picture

FileSize
2.57 KB
dbjpanda’s picture

@ankitjain28may submit a patch which can fix the above issue of the Ace Code Editor. You need to manually correct those errors/warning.

ankitjain28may’s picture

I have fixed the issues that need to be fixed manually, Please review the patch.

ankitjain28may’s picture

Status: Active » Needs review

  • interdruper committed bd7f580 on 8.x-1.x
    Issue #2846029 by interdruper: Satisfy PHP CodeSniffer coding standards...
  • interdruper committed c1a0c7b on 8.x-1.x authored by ankitjain28may
    Issue #2846029 by ankitjain28may: Satisfy PHP CodeSniffer coding...
interdruper’s picture

Status: Needs review » Fixed

Fixed on 8.x-1.1.

Status: Fixed » Closed (fixed)

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