Problem/Motivation
The following code style standards exist the current codebase:
FILE: ./web/modules/contrib/alinks/alinks.module
------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
8 | ERROR | [x] When importing a class with "use", do not include a leading \
9 | ERROR | [x] When importing a class with "use", do not include a leading \
------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/tests/src/Kernel/AlinkPostRendererTest.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
14 | ERROR | Missing short description in doc comment
19 | ERROR | Missing short description in doc comment
43 | ERROR | Doc comment is empty
-----------------------------------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/src/Form/KeywordSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 32 ERRORS AND 2 WARNINGS AFFECTING 32 LINES
-------------------------------------------------------------------------------------------------------------------------
20 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
23 | ERROR | [ ] Missing member variable doc comment
25 | ERROR | [ ] Missing member variable doc comment
63 | ERROR | [ ] Missing short description in doc comment
64 | ERROR | [ ] Missing parameter comment
65 | ERROR | [ ] Missing parameter comment
104 | ERROR | [x] Short array syntax must be used to define arrays
118 | ERROR | [x] Short array syntax must be used to define arrays
143 | ERROR | [ ] Missing parameter comment
144 | ERROR | [ ] Missing parameter comment
146 | ERROR | [ ] Description for the @return value is missing
152 | ERROR | [ ] Missing short description in doc comment
153 | ERROR | [ ] Missing parameter comment
153 | ERROR | [ ] Doc comment for parameter $form does not match actual variable name $form_state
154 | ERROR | [ ] Missing parameter comment
175 | ERROR | [x] Short array syntax must be used to define arrays
181 | ERROR | [x] Short array syntax must be used to define arrays
189 | ERROR | [x] Short array syntax must be used to define arrays
197 | ERROR | [x] Short array syntax must be used to define arrays
228 | ERROR | [x] Short array syntax must be used to define arrays
239 | ERROR | [ ] Missing short description in doc comment
240 | ERROR | [ ] Missing parameter comment
240 | ERROR | [ ] Doc comment for parameter $form does not match actual variable name $form_state
241 | ERROR | [ ] Missing parameter comment
242 | ERROR | [ ] Description for the @return value is missing
248 | ERROR | [x] Short array syntax must be used to define arrays
250 | ERROR | [x] Short array syntax must be used to define arrays
264 | ERROR | [x] Short array syntax must be used to define arrays
268 | ERROR | [x] Short array syntax must be used to define arrays
272 | ERROR | [x] Short array syntax must be used to define arrays
276 | ERROR | [x] Short array syntax must be used to define arrays
278 | ERROR | [x] Short array syntax must be used to define arrays
279 | ERROR | [x] Short array syntax must be used to define arrays
281 | WARNING | [x] A comma should follow the last multiline array item. Found: )
-------------------------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/src/Entity/Keyword.php
---------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------------
68 | ERROR | [x] Short array syntax must be used to define arrays
161 | ERROR | [x] Short array syntax must be used to define arrays
173 | ERROR | [x] Short array syntax must be used to define arrays
178 | ERROR | [x] Short array syntax must be used to define arrays
183 | ERROR | [x] Short array syntax must be used to define arrays
207 | ERROR | [x] Short array syntax must be used to define arrays
211 | ERROR | [x] Short array syntax must be used to define arrays
---------------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/src/Entity/KeywordViewsData.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Short array syntax must be used to define arrays
26 | ERROR | [x] Short array syntax must be used to define arrays
------------------------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/src/KeywordListBuilder.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
29 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------------------------------------------
FILE: ./web/modules/contrib/alinks/src/AlinkPostRenderer.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 6 WARNINGS AFFECTING 21 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
16 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [ ] Missing member variable doc comment
20 | ERROR | [ ] Missing member variable doc comment
29 | ERROR | [ ] Missing member variable doc comment
31 | ERROR | [ ] Missing member variable doc comment
37 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
39 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
41 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
43 | ERROR | [ ] Type hint "\Drupal\Core\Render\Markup" missing for $content
43 | ERROR | [ ] Type hint "array" missing for $context
43 | ERROR | [ ] Type hint "null" missing for $xpathSelector
104 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
133 | WARNING | [x] '@TODO: Make it configurable replaceAll vs. replaceFirst' should match the format '@todo Fix problem X here.'
160 | WARNING | [x] '@TODO: Make it configurable replaceAll vs. replaceFirst' should match the format '@todo Fix problem X here.'
172 | ERROR | [ ] Doc comment is empty
178 | WARNING | [x] '@todo: Try stemmer' should match the format '@todo Fix problem X here.'
191 | WARNING | [x] '@TODO: Look at Search API Tokenizer & Highlighter' should match the format '@todo Fix problem X here.'
213 | ERROR | [ ] Doc comment is empty
230 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
256 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
260 | WARNING | [x] '@TODO: Remove keywords with links which are already in the text' should match the format '@todo Fix problem X here.'
274 | ERROR | [x] Expected 1 blank line after function; 2 found
----------------------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3302380-8.patch | 0 bytes | erikaagp |
| #6 | interdiff_3-6.txt | 2.77 KB | Munavijayalakshmi |
| #6 | 3302380-6.patch | 19.43 KB | Munavijayalakshmi |
| #4 | 3302380-3.patch | 17.21 KB | dspachos |
Issue fork alinks-3302380
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
Comment #2
dspachos commentedComment #3
dspachos commentedComment #4
dspachos commentedComment #5
Munavijayalakshmi commentedAfter applying patch of 3 in #4, we are getting some more errors
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig alinks/
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/alinks.links.task.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
16 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/src/AlinkPostRenderer.php
---------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 5 WARNINGS AFFECTING 12 LINES
---------------------------------------------------------------------------------------------------------
17 | ERROR | Missing member variable doc comment
19 | ERROR | Missing member variable doc comment
21 | ERROR | Missing member variable doc comment
30 | ERROR | Missing member variable doc comment
32 | ERROR | Missing member variable doc comment
44 | ERROR | Type hint "null" missing for $xpathSelector
71 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
76 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
79 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
83 | WARNING | Term::loadMultiple calls should be avoided in classes, use dependency injection instead
132 | WARNING | Unused variable $key.
249 | ERROR | Type hint "array" missing for $context
---------------------------------------------------------------------------------------------------------
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/src/Form/KeywordSettingsForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
274 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
275 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
276 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
277 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
303 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/alinks.info.yml
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/config/schema/alinks.schema.yml
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
22 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/config/install/alinks.settings.yml
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
Time: 353ms; Memory: 12MB
Comment #6
Munavijayalakshmi commentedRectified all errors except following,
FILE: /var/www/html/vb/drupal-2821827/modules/contrib/alinks/src/AlinkPostRenderer.php
---------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------
59 | ERROR | Type hint "null" missing for $xpathSelector
86 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
94 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
98 | WARNING | Term::loadMultiple calls should be avoided in classes, use dependency injection instead
147 | WARNING | Unused variable $key.
264 | ERROR | Type hint "array" missing for $context
---------------------------------------------------------------------------------------------------------
Time: 675ms; Memory: 12MB
Comment #7
dspachos commentedHi @munavijayalakshmi, thanks for the updates! I'll come back on this one, esp. on the DI issues.
Comment #8
erikaagp commentedI'll work on it!
Comment #9
greg boggsCan you open a merge request from the latest patch? https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Comment #10
erikaagp commentedHi, I tried to fix some of those errors, but it still needs some work... 3302380-8.patch
Comment #11
erikaagp commentedComment #12
arti_parmar commentedComment #13
arti_parmar commentedI have applied a patch for "Coding style violations" please kindly review patch.
Thanks!
Comment #14
greg boggsThanks. Can you post a merge request to make review and commit easier?
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Comment #17
sonvir249 commented@greg-boggs I have created a MR, and pushed all the phpcs fixes.
Comment #19
greg boggs