Problem/Motivation

Coding standards cleanup needed.

Proposed resolution

Run a code sniffer and fix the formatting issues.

Remaining tasks

  1. Run sniffer
  2. Fix code formatting issues
  3. Review
  4. Commit

User interface changes

API changes

Data model changes

Comments

Kristen Pol created an issue. See original summary.

siddhant.bhosale’s picture

Assigned: Unassigned » siddhant.bhosale
kristen pol’s picture

Assigned: siddhant.bhosale » Unassigned

Unassigning since it's been awhile.

urvashi_vora’s picture

Status: Active » Needs review
StatusFileSize
new139.49 KB

Hi,
Please review the patch, I tried fixing coding standards using PHPCS.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi
tmaiochi’s picture

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

Hi @urvashi_vora, I got this errors/warnings in PHPCS.


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Plugin/Purge/Purger/SectionPurger.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 16 WARNINGS AFFECTING 17 LINES
---------------------------------------------------------------------------------------------------------------------------
  19 | WARNING | Line exceeds 80 characters; contains 107 characters
  29 | WARNING | Line exceeds 80 characters; contains 82 characters
  30 | WARNING | Line exceeds 80 characters; contains 109 characters
  46 | WARNING | Line exceeds 80 characters; contains 106 characters
  58 | WARNING | Line exceeds 80 characters; contains 89 characters
  58 | ERROR   | Doc comment short description must end with a full stop
  58 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  61 | WARNING | Line exceeds 80 characters; contains 109 characters
  63 | ERROR   | If there is no return value for a function, there must not be a @return tag.
  63 | ERROR   | Description for the @return value is missing
  67 | WARNING | Unused variable $globalExpression.
  74 | WARNING | Line exceeds 80 characters; contains 106 characters
  95 | WARNING | Line exceeds 80 characters; contains 84 characters
  96 | WARNING | Line exceeds 80 characters; contains 83 characters
  97 | WARNING | Line exceeds 80 characters; contains 88 characters
  98 | WARNING | Line exceeds 80 characters; contains 86 characters
  99 | WARNING | Line exceeds 80 characters; contains 83 characters
 103 | WARNING | Line exceeds 80 characters; contains 132 characters
 104 | WARNING | Line exceeds 80 characters; contains 239 characters
 106 | WARNING | Line exceeds 80 characters; contains 182 characters
---------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Plugin/Purge/Purger/SectionBundledPurger.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 17 WARNINGS AFFECTING 22 LINES
----------------------------------------------------------------------------------------------------------------------------------
  20 | WARNING | Line exceeds 80 characters; contains 107 characters
  30 | WARNING | Line exceeds 80 characters; contains 82 characters
  31 | WARNING | Line exceeds 80 characters; contains 109 characters
  38 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  40 | ERROR   | Missing parameter comment
  42 | ERROR   | Description for the @return value is missing
  78 | WARNING | Line exceeds 80 characters; contains 106 characters
  95 | WARNING | Line exceeds 80 characters; contains 89 characters
  95 | ERROR   | Doc comment short description must end with a full stop
  95 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  98 | WARNING | Line exceeds 80 characters; contains 116 characters
 100 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 100 | ERROR   | Description for the @return value is missing
 104 | WARNING | Unused variable $globalExpression.
 106 | WARNING | Line exceeds 80 characters; contains 148 characters
 115 | WARNING | Line exceeds 80 characters; contains 104 characters
 135 | ERROR   | Public method name "SectionBundledPurger::invalidateURLs" is not in lowerCamel format
 199 | WARNING | Line exceeds 80 characters; contains 84 characters
 200 | WARNING | Line exceeds 80 characters; contains 83 characters
 201 | WARNING | Line exceeds 80 characters; contains 88 characters
 202 | WARNING | Line exceeds 80 characters; contains 86 characters
 203 | WARNING | Line exceeds 80 characters; contains 83 characters
 207 | WARNING | Line exceeds 80 characters; contains 132 characters
 208 | WARNING | Line exceeds 80 characters; contains 239 characters
 210 | WARNING | Line exceeds 80 characters; contains 182 characters
----------------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Plugin/Purge/Purger/SectionPurgerBase.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 35 ERRORS AND 17 WARNINGS AFFECTING 38 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
  77 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  79 | ERROR   | Missing parameter comment
  83 | ERROR   | Parameter comment must start with a capital letter
  85 | ERROR   | Parameter comment must start with a capital letter
  87 | ERROR   | If there is no return value for a function, there must not be a @return tag.
  87 | ERROR   | Description for the @return value is missing
  89 | ERROR   | Type hint "Invalidation" missing for $invalidation
  89 | ERROR   | Type hint "array" missing for $opt
  90 | WARNING | Line exceeds 80 characters; contains 139 characters
  95 | WARNING | Unused variable $response.
 154 | ERROR   | Type hint "array" missing for $token_data
 195 | ERROR   | Type hint "array" missing for $token_data
 197 | ERROR   | The array declaration extends to column 129 (the limit is 80). The array content should be split up over multiple lines
 203 | WARNING | Line exceeds 80 characters; contains 92 characters
 232 | ERROR   | The array declaration extends to column 104 (the limit is 80). The array content should be split up over multiple lines
 244 | ERROR   | Type hint "array" missing for $token_data
 258 | ERROR   | Doc comment is empty
 276 | WARNING | Line exceeds 80 characters; contains 121 characters
 277 | ERROR   | Doc comment short description must end with a full stop
 277 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 280 | WARNING | Line exceeds 80 characters; contains 109 characters
 282 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 282 | ERROR   | Description for the @return value is missing
 319 | ERROR   | Doc comment short description must end with a full stop
 319 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 322 | WARNING | Line exceeds 80 characters; contains 109 characters
 324 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 324 | ERROR   | Description for the @return value is missing
 344 | ERROR   | Expected 0 spaces before comma; 8 found
 350 | WARNING | Line exceeds 80 characters; contains 106 characters
 364 | ERROR   | Doc comment short description must end with a full stop
 364 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 367 | WARNING | Line exceeds 80 characters; contains 109 characters
 369 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 369 | ERROR   | Description for the @return value is missing
 385 | WARNING | Line exceeds 80 characters; contains 102 characters
 386 | WARNING | Line exceeds 80 characters; contains 104 characters
 386 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 393 | WARNING | Line exceeds 80 characters; contains 103 characters
 394 | WARNING | Line exceeds 80 characters; contains 104 characters
 394 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 403 | WARNING | Line exceeds 80 characters; contains 95 characters
 403 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 406 | WARNING | Line exceeds 80 characters; contains 109 characters
 408 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 408 | ERROR   | Description for the @return value is missing
 425 | WARNING | Line exceeds 80 characters; contains 97 characters
 425 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 428 | WARNING | Line exceeds 80 characters; contains 109 characters
 430 | ERROR   | If there is no return value for a function, there must not be a @return tag.
 430 | ERROR   | Description for the @return value is missing
 439 | WARNING | Line exceeds 80 characters; contains 106 characters
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 32 | WARNING | Line exceeds 80 characters; contains 89 characters
 77 | ERROR   | The array declaration extends to column 140 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Plugin/Purge/Invalidation/RawInvalidation.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
 9 | WARNING | Line exceeds 80 characters; contains 96 characters
-----------------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Form/SectionPurgerFormBase.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  29 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
  86 | ERROR   | Public method name "SectionPurgerFormBase::getFormID" is not in lowerCamel format
 212 | ERROR   | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/src/Entity/SectionPurgerSettings.php
----------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------
 117 | ERROR | Class property $request_method should use lowerCamel naming without underscores
 162 | ERROR | Class property $body_content_type should use lowerCamel naming without underscores
 176 | ERROR | Class property $runtime_measurement should use lowerCamel naming without underscores
 190 | ERROR | Class property $connect_timeout should use lowerCamel naming without underscores
 200 | ERROR | Class property $cooldown_time should use lowerCamel naming without underscores
 211 | ERROR | Class property $max_requests should use lowerCamel naming without underscores
 224 | ERROR | Class property $http_errors should use lowerCamel naming without underscores
----------------------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/README.md
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
-------------------------------------------------------------------------------------------
  2 | WARNING | Line exceeds 80 characters; contains 321 characters
 12 | WARNING | Line exceeds 80 characters; contains 124 characters
 13 | WARNING | Line exceeds 80 characters; contains 255 characters
 14 | WARNING | Line exceeds 80 characters; contains 128 characters
 15 | WARNING | Line exceeds 80 characters; contains 273 characters
 16 | WARNING | Line exceeds 80 characters; contains 299 characters
 17 | WARNING | Line exceeds 80 characters; contains 113 characters
 18 | WARNING | Line exceeds 80 characters; contains 186 characters
 19 | WARNING | Line exceeds 80 characters; contains 684 characters
 20 | WARNING | Line exceeds 80 characters; contains 234 characters
 21 | WARNING | Line exceeds 80 characters; contains 671 characters
 22 | WARNING | Line exceeds 80 characters; contains 396 characters
 23 | WARNING | Line exceeds 80 characters; contains 485 characters
 24 | WARNING | Line exceeds 80 characters; contains 600 characters
-------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/section_purger.info.yml
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------
  1 | WARNING | [ ] "core_version_requirement" property is missing in the info.yml file
  6 | WARNING | [ ] All dependencies must be prefixed with the project name, for example "drupal:"
  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:"
 10 | ERROR   | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------


FILE: /home/tmaiochi/Documents/Projects/drupal8/web/modules/contrib/section_purge/Tests/SectionPurgerFormTestBase.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  56 | WARNING | Line exceeds 80 characters; contains 84 characters
 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Time: 348ms; Memory: 12MB

victoria-marina’s picture

Assigned: Unassigned » victoria-marina

I'll work on this.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
Status: Needs work » Needs review
StatusFileSize
new151.72 KB
new49.97 KB

Here is a patch. Kindly review it.

kristen pol’s picture

Status: Needs review » Needs work
StatusFileSize
new180.77 KB
new352.76 KB

Thanks for the patch. I didn't review all the items but I did see there are lots of extra spaces at the end of lines that need to be removed.

victoria-marina’s picture

Assigned: Unassigned » victoria-marina
Issue summary: View changes

@kristen-pol Thank you! I'll work on that.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
Status: Needs work » Needs review
StatusFileSize
new151.66 KB
new9.08 KB

Here is a new patch.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this

tmaiochi’s picture

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

Hey @victoria-marina. The patch fixed all errors/warnings from PHPCS, except by

FILE: /section_purge/section_purger.info.yml
---------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
 1 | WARNING | "core_version_requirement" property is missing in the info.yml file
---------------------------------------------------------------------------------------------------------
kristen pol’s picture

Version: 8.x-2.3-rc2 » 3.0.0-alpha1

This should be against the latest version 3.0.0-alpha1 so that shouldn’t be necessary.

kristen pol’s picture

Status: Needs work » Needs review
joshua1234511’s picture

StatusFileSize
new27.69 KB
new142.88 KB

Tried the patch provided in #11. Could not apply it against 3.0.0-alpha1.
Could not apply patch

Patch provided against v3.0.0-alpha1

victoria-marina’s picture

Assigned: Unassigned » victoria-marina

I'll review this.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
StatusFileSize
new153.5 KB
new33.99 KB

@joshua1234511 Thank you for the patch!

After the #16 I still got the errors below and I made a patch for them.

FILE: .../section_purge/README.md
------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 14 WARNINGS AFFECTING 15 LINES
------------------------------------------------------------------------------------------
  2 | WARNING | [ ] Line exceeds 80 characters; contains 321 characters
 12 | WARNING | [ ] Line exceeds 80 characters; contains 124 characters
 13 | WARNING | [ ] Line exceeds 80 characters; contains 255 characters
 14 | WARNING | [ ] Line exceeds 80 characters; contains 128 characters
 15 | WARNING | [ ] Line exceeds 80 characters; contains 273 characters
 16 | WARNING | [ ] Line exceeds 80 characters; contains 299 characters
 17 | WARNING | [ ] Line exceeds 80 characters; contains 113 characters
 18 | WARNING | [ ] Line exceeds 80 characters; contains 186 characters
 19 | WARNING | [ ] Line exceeds 80 characters; contains 684 characters
 20 | WARNING | [ ] Line exceeds 80 characters; contains 234 characters
 21 | WARNING | [ ] Line exceeds 80 characters; contains 671 characters
 22 | WARNING | [ ] Line exceeds 80 characters; contains 396 characters
 23 | WARNING | [ ] Line exceeds 80 characters; contains 485 characters
 24 | WARNING | [ ] Line exceeds 80 characters; contains 600 characters
 39 | ERROR   | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------


FILE: .../section_purge/Tests/SectionPurgerFormTest.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/Tests/SectionPurgerFormTestBase.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  56 | WARNING | Line exceeds 80 characters; contains 84 characters
 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Form/SectionPurgerForm.php
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Form/SectionPurgerFormBase.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------
  30 | WARNING | [ ] '@todo' should match the format '@todo Fix problem X here.'
 219 | WARNING | [x] A comma should follow the last multiline array item. Found: '[invalidation:expression]'
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Form/SectionBundledPurgerForm.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
 32 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
 87 | WARNING | [x] A comma should follow the last multiline array item. Found: 'scheme'
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Plugin/Purge/Invalidation/RawInvalidation.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
 9 | WARNING | Line exceeds 80 characters; contains 96 characters
----------------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Plugin/Purge/Purger/SectionPurgerBase.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES
------------------------------------------------------------------------------------------------------------------------------
  10 | WARNING | [x] Unused use statement
  12 | WARNING | [x] Unused use statement
  97 | WARNING | [ ] Unused variable $response.
 118 | WARNING | [x] A comma should follow the last multiline array item. Found: $headers
 201 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 208 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
 246 | WARNING | [x] A comma should follow the last multiline array item. Found: "raw"
 317 | WARNING | [x] A comma should follow the last multiline array item. Found: '/\*/'
 322 | WARNING | [x] A comma should follow the last multiline array item. Found: '.*'
 356 | WARNING | [x] A comma should follow the last multiline array item. Found: '/\*/'
 367 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
 466 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Plugin/Purge/Purger/SectionPurger.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 18 WARNINGS AFFECTING 18 LINES
--------------------------------------------------------------------------------------------------------------------------
   7 | WARNING | [x] Unused use statement
   8 | WARNING | [x] Unused use statement
  21 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
  31 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
  32 | WARNING | [ ] Line exceeds 80 characters; contains 109 characters
  48 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
  62 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
  70 | WARNING | [ ] Unused variable $globalExpression.
  77 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
  98 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
  99 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 100 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
 101 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 102 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 106 | WARNING | [ ] Line exceeds 80 characters; contains 132 characters
 107 | WARNING | [ ] Line exceeds 80 characters; contains 239 characters
 109 | WARNING | [ ] Line exceeds 80 characters; contains 182 characters
 122 | WARNING | [x] A comma should follow the last multiline array item. Found: 'invalidateRawExpression'
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/src/Plugin/Purge/Purger/SectionBundledPurger.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 19 WARNINGS AFFECTING 19 LINES
---------------------------------------------------------------------------------------------------------------------------------
   7 | WARNING | [x] Unused use statement
   8 | WARNING | [x] Unused use statement
  11 | WARNING | [x] Unused use statement
  23 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
  33 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
  34 | WARNING | [ ] Line exceeds 80 characters; contains 109 characters
  84 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
 112 | WARNING | [ ] Unused variable $globalExpression.
 114 | WARNING | [ ] Line exceeds 80 characters; contains 148 characters
 123 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
 207 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 208 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 209 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
 210 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 211 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 215 | WARNING | [ ] Line exceeds 80 characters; contains 132 characters
 216 | WARNING | [ ] Line exceeds 80 characters; contains 239 characters
 218 | WARNING | [ ] Line exceeds 80 characters; contains 182 characters
 231 | WARNING | [x] A comma should follow the last multiline array item. Found: 'invalidateRawExpression'
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: .../section_purge/section_purger.info.yml
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------
 6 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 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:"
--------------------------------------------------------------------------------------------------------

Time: 222ms; Memory: 12MB
victoria-marina’s picture

StatusFileSize
new153.5 KB

I made a typo on the last one. Here is the correct patch.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this!

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

Steps performed:
(1) Installed module
(2) Reproduced the issue.
(3) Applied patch.
(4) Code review on changes.
(5) Tested again with patch, issue resolved.
This patch in #19 fixed all messages from PHPCS, and the module is working fine as far as I can test.

kristen pol’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for updating the patch @victoria-marina and for reviewing the patch @tmaiochi.

@tmaiochi Would you add a comment how you tested the module?

I didn't review the whole patch but there are still some comment oddities like the items below. It would be good to do a final pass and get the comments as close to (but not over) 80 characters. Thanks.

  1. +++ b/README.md
    @@ -1,5 +1,9 @@
    +respond to invalidation events from a Drupal instance in exactly the same
    +way that Drupal’s internal cache or a local varnish cache running on the
    +host machine does, ensuring that the content in Section’s global caching
    

    Nitpick: Doesn't look like things made it as close to 80 chars as possible.

  2. +++ b/README.md
    -- If you wish to uninstall the Plugin from a live site for the purposes of testing, the most efficient way to do so is to uninstall the plugin from the admin console. Once it has been uninstalled there, you can delete it from the filesystem of the live box (Drupal may overwrite old files of the same name if you try and upload the same module again — this has not been proven). Deleting the module from the filesystem while it is still installed will cause a total failure of the site. The only known fix for this is a reinstall of Drupal as a whole, although there are likely easier ways to fix it. 
    +tag invalidations in the queue. Bundled URL purging is not supported but we
    +are open to feedback – after consulting with the back-end team, the opinion
    

    Same as above.

lucienchalom’s picture

Status: Needs work » Needs review
StatusFileSize
new153.45 KB
new7.93 KB

I tried to work on #22 request, to go as close to 80 characters on readme
I also found 3 "Use null coalesce operator instead of ternary operator." and changed them.
I could not run tests locally because the module refers to purge_ui.

kristen pol’s picture

Assigned: Unassigned » yusufhm

Assigning to Yusuf.

yusufhm’s picture

StatusFileSize
new153.44 KB
new1.22 KB

There is no phpcs error anymore, but just two minor changes.

When I tried to git apply the patch at #23 I got the following even though the patch was correctly applied:

3240978-23.patch:82: trailing whitespace.
section config). Usually the name for the proxy is 'varnish' but some
3240978-23.patch:88: trailing whitespace.
- If you wish to uninstall the Plugin from a live site for the purposes of
warning: 2 lines add whitespace errors.

I've gotten rid of those two whitespaces and created a new patch for it.

kristen pol’s picture

Status: Needs review » Reviewed & tested by the community

Given Yusuf doesn't see any code style issues anymore, moving to RTBC.

@yusufhm Would you get this merged in please?

  • yusufhm committed 1f76cf7 on 3.x
    Issue #3240978 by victoria-marina, yusufhm, joshua1234511, lucienchalom...
kristen pol’s picture

Status: Reviewed & tested by the community » Fixed

@yusufhm Thanks for committing.

Status: Fixed » Closed (fixed)

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