Problem/Motivation

FILE: /home/lenovo/druapl7to9/web/modules/contrib/twig_backlink/src/TwigBacklinkTwigExtension.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 16 ERRORS AND 6 WARNINGS AFFECTING 17 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   2 | WARNING | [x] There must be no blank line following an inline comment
   2 | WARNING | [ ] There must be no blank line following an inline comment
   2 | ERROR   | [ ] Namespaced classes, interfaces and traits should not begin with a file doc comment
   2 | ERROR   | [x] No space found before comment text; expected "// #Drush auto-generate all file" but found "//#Drush auto-generate all file"
   6 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
  17 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
  85 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 105 | WARNING | [ ] Node::load calls should be avoided in classes, use dependency injection instead
 112 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 133 | ERROR   | [ ] Description for the @return value is missing
 140 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 145 | ERROR   | [x] Expected 1 blank line after function; 0 found
 146 | ERROR   | [x] The closing brace for the class must have an empty line before it
 152 | ERROR   | [ ] Description for the @return value is missing
 154 | ERROR   | [x] Expected 1 blank line before function; 2 found
 154 | ERROR   | [x] Incorrect spacing between argument "$order" and equals sign; expected 1 but found 0
 154 | ERROR   | [x] Incorrect spacing between default value and equals sign for argument "$order"; expected 1 but found 0
 155 | ERROR   | [x] Short array syntax must be used to define arrays
 156 | ERROR   | [x] Short array syntax must be used to define arrays
 157 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 168 | ERROR   | [x] Expected newline after closing brace
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/twig_backlink/src/Form/TwigBacklinkConfigurationForm.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------
 42 | ERROR   | [x] No space found before comment text; expected "// '#required' => TRUE," but found "//'#required' => TRUE,"
 55 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/twig_backlink/README.md
-------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------
  2 | WARNING | [ ] Line exceeds 80 characters; contains 155 characters
  9 | WARNING | [ ] Line exceeds 80 characters; contains 129 characters
 13 | ERROR   | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/twig_backlink/twig_backlink.module
------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------
 22 | ERROR   | [x] Concat operator must be surrounded by a single space
 23 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------

Time: 82ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig twig_backline/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#11 3372626-phpcs-resolve-11.patch6.53 KBsakthi_dev
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

roshni27’s picture

roshni27 created an issue.
I am working on it.

roshni27’s picture

Assigned: roshni27 » Unassigned
Status: Needs work » Needs review

Please review MR

avpaderno’s picture

Issue tags: -Code Standards +Coding standards

xmacinfo made their first commit to this issue’s fork.

  • xmacinfo committed 72cdb925 on 2.0.x
    Revert "Resolve #3372626 "Fix the warningserrors""
    
    This reverts commit...
xmacinfo’s picture

Although we need to fix coding standards, a patch must be tested by its authors.

I had to revert this because of a major error:

TypeError: Drupal\twig_backlink\TwigBacklinkTwigExtension::__construct(): Argument #1 ($language_manager) must be of type Drupal\Core\Language\LanguageManagerInterface, Drupal\Core\Routing\CurrentRouteMatch given, called in /Users/jrblier/web/Sites/portable.bd.livres/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\twig_backlink\TwigBacklinkTwigExtension->__construct() (line 59 of modules/contrib/twig_backlink/src/TwigBacklinkTwigExtension.php).

Of course, the merge request was not marked as RTBC, but the original poster should do a minimal installation.

I will accept a new MR or a patch for review.

roshni27’s picture

Assigned: Unassigned » roshni27
Status: Needs review » Needs work

I am working on it.

roshni27’s picture

Assigned: roshni27 » Unassigned
sakthi_dev’s picture

Status: Needs work » Needs review
StatusFileSize
new6.53 KB

Created a new patch. Please review.

xmacinfo’s picture

Did you run that patch on an actual installation?