Problem/Motivation
Resolve the PHP Coding standard issue.
FILE: /var/www/html/web/modules/custom/token_views_filter/tests/modules/token_views_filter_test/token_views_filter_test.tokens.inc
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | ERROR | [x] When importing a class with "use", do not include a leading \
6 | 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."
25 | ERROR | [x] Expected 1 blank line after function; 2 found
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/token_views_filter/tests/src/Functional/TokenViewsFilterTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
28 | ERROR | The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/token_views_filter/tests/src/Kernel/TokenReplacementTest.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
28 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
80 | WARNING | [x] A comma should follow the last multiline array item. Found: 'date'
90 | WARNING | [x] A comma should follow the last multiline array item. Found: 'date'
139 | WARNING | [x] A comma should follow the last multiline array item. Found: 'date'
149 | WARNING | [x] A comma should follow the last multiline array item. Found: 'date'
153 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/token_views_filter/README.md
-------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------
27 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
32 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
85 | ERROR | [x] Expected 1 space before "/"; 0 found
85 | ERROR | [x] Expected 1 space after "/"; 0 found
85 | ERROR | [x] Expected 1 space before "/"; 0 found
85 | ERROR | [x] Expected 1 space after "/"; 0 found
85 | ERROR | [x] Concat operator must be surrounded by a single space
85 | ERROR | [x] Concat operator must be surrounded by a single space
90 | ERROR | [x] Concat operator must be surrounded by a single space
90 | ERROR | [x] Concat operator must be surrounded by a single space
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/token_views_filter/src/TokensFilterTrait.php
-----------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-----------------------------------------------------------------------------------
76 | ERROR | [x] Doc comment long description must end with a full stop
89 | ERROR | [x] Whitespace found at end of line
91 | ERROR | [x] Whitespace found at end of line
113 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
139 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------
Steps to reproduce
Run the Code sniffer
Run the phpcs --standard="DrupalPractice,DrupalStandard" token_views_filter
Proposed resolution
Resolve the PHPCS issues.
Remaining tasks
Testing
User interface changes
API changes
Data model changes
Comments
Comment #3
arunkumarkComment #4
akram khanchecked MR still there is one issue
FILE: ...ktop/Contribution/drupal9.5.x/drupal/modules/contrib/token_views_filter/src/TokensFilterTrait.php
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
139 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------
Comment #5
akram khanadded updated patch and Fixed remaining issue
Comment #6
akshaydalvi212 commentedhello Team,
I will review the patch #5.
Comment #7
akshaydalvi212 commentedHello Team,
Patch #5 gets applied and fixes all the issues reported by PHPCS.
so #5 is ready to move to RTBC. i.e. RTBC +1.
Comment #8
avpadernoAfter a comma, for is not spelled in capital case.
Hook does not need to be in capital case, since it is not at the beginning of a sentence.
That comment is usually Hook implementations for [module name].
Comment #9
akshaydalvi212 commentedHello @apaderno
Will work on the #5 patch and make changes as per your suggection and provide the new patch.
Comment #10
akshaydalvi212 commentedFixed remaining issues reported with PHPCS.
Kindly review.
Comment #11
avpadernoThat line is correct as it is.
It is not necessary to say which is the parent class; parent method is sufficient.
The usual comment is Hook implementations for [module name].
Primarily is an adverb; it cannot be used to alter a noun phrase (Drupal hooks).
Drupal does not make any distinction between primary and secondary hooks. The usual comment is another one.
Comment #16
shivam_tiwari commentedComment #17
avpadernoIt has been already pointed out that change is wrong.
A word after a comma does not need to be written in capital case, except in the case that word is always written in capital case.
This module name is not [module name]. Clearly, in my previous comment, I used a placeholder since, speaking for every module, I cannot list the names of every module.
Comment #18
shivam_tiwari commentedComment #19
avpadernoThe module name should also respect uppercase letters.
That comment is not correct for the reasons I have already reported. It does not describe the purpose of the functions contained in the token_views_filter.views.inc file, then.
Comment #20
amit.rawat777 commentedI have fixed the issue please review.
Comment #21
shivam_tiwari commentedI updated commit, Please review now.
Comment #22
avpadernoA .views.inc file contains hook implementations used by the Views module. The correct description is Hook implementations used by the Views module. or Hook implementations used by Views. invoked is a fine replacement for used.
Comment #23
arunkumarkAs per comment #22, I updated the Description of the hook implementation.
Comment #24
arunkumarkComment #25
shivam_tiwari commentedUpdated all the code as per the comments. Please check.
Comment #26
avpadernoSpaces in file paths are not used. It is already correct as it is.
Comment #27
shivam_tiwari commentedComment #28
validoll commentedThanks for all!!!!
Changes has been merged to dev branch.