Phpcs standard fix.

Created on 6 August 2020, over 4 years ago
Updated 8 July 2024, 5 months ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

5.0

Component

Code

Created by

🇮🇳India suresh prabhu parkala Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India riddhi.addweb

    I have applied the patch but it is failing.
    Please check the screenshots for the same.

  • Status changed to Needs work 5 months ago
  • 🇵🇭Philippines clarkssquared

    Hi

    I applied patch #2 and I can still see many PHPCS issues being reported:

      bootstrap_layouts git:(f6b43a4) curl https://www.drupal.org/files/issues/2020-08-06/3163689-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 10556  100 10556    0     0  21914      0 --:--:-- --:--:-- --:--:-- 22223
    patching file bootstrap_layouts.api.php
    patching file 'src/Annotation/BootstrapLayoutsUpdate.php'
    patching file 'src/BootstrapLayout.php'
    patching file 'src/BootstrapLayoutsManager.php'
    patching file 'src/BootstrapLayoutsPluginManager.php'
    patching file 'src/BootstrapLayoutsUninstallValidator.php'
    patching file 'src/BootstrapLayoutsUpdateManager.php'
    patching file 'src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerBase.php'
    patching file 'src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerInterface.php'
    patching file 'src/Plugin/BootstrapLayouts/BootstrapLayoutsUpdateBase.php'
    patching file 'src/Plugin/BootstrapLayouts/BootstrapLayoutsUpdateInterface.php'
    patching file 'src/Plugin/BootstrapLayouts/Updates/BootstrapLayoutsUpdate8401.php'
    patching file 'src/Plugin/BootstrapLayouts/Updates/BootstrapLayoutsUpdate8402.php'
    patching file 'src/Plugin/Layout/BootstrapLayoutsBase.php'
    ➜  bootstrap_layouts git:(f6b43a4) ✗ ..
    ➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bootstrap_layouts    
    
    FILE: ...upal_local/web/modules/contrib/bootstrap_layouts/bootstrap_layouts.install
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     66 | ERROR | Inline doc block comments are not allowed; use "/* Comment */" or
        |       | "// Comment" instead
     74 | ERROR | Inline doc block comments are not allowed; use "/* Comment */" or
        |       | "// Comment" instead
    --------------------------------------------------------------------------------
    
    
    FILE: .../Projects/d10/drupal_local/web/modules/contrib/bootstrap_layouts/README.md
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     3 | WARNING | Line exceeds 80 characters; contains 81 characters
    --------------------------------------------------------------------------------
    
    
    FILE: ...rupal_local/web/modules/contrib/bootstrap_layouts/bootstrap_layouts.module
    --------------------------------------------------------------------------------
    FOUND 7 ERRORS AFFECTING 7 LINES
    --------------------------------------------------------------------------------
      64 | ERROR | [x] list(...) is forbidden, use [...] instead.
      91 | ERROR | [x] Use null coalesce operator instead of ternary operator.
      92 | ERROR | [x] Use null coalesce operator instead of ternary operator.
      93 | ERROR | [x] Use null coalesce operator instead of ternary operator.
      94 | ERROR | [x] Use null coalesce operator instead of ternary operator.
     106 | ERROR | [x] Use null coalesce operator instead of ternary operator.
     163 | ERROR | [ ] The array declaration extends to column 96 (the limit is
         |       |     80). The array content should be split up over multiple
         |       |     lines
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...dules/contrib/bootstrap_layouts/src/BootstrapLayoutsUninstallValidator.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     10 | WARNING | The class short comment should describe what the class does and
        |         | not simply repeat the class name
    --------------------------------------------------------------------------------
    
    
    FILE: ...eb/modules/contrib/bootstrap_layouts/src/BootstrapLayoutsPluginManager.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     65 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     75 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
    --------------------------------------------------------------------------------
    
    
    FILE: ...dules/contrib/bootstrap_layouts/src/Plugin/Layout/BootstrapLayoutsBase.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------
      11 | ERROR   | [x] Use statements should be sorted alphabetically. The first
         |         |     wrong one is Drupal\Core\Layout\LayoutDefault.
      21 | WARNING | [ ] Possible useless method overriding detected
     134 | ERROR   | [ ] The array declaration extends to column 93 (the limit is
         |         |     80). The array content should be split up over multiple
         |         |     lines
     141 | ERROR   | [ ] The array declaration extends to column 81 (the limit is
         |         |     80). The array content should be split up over multiple
         |         |     lines
     153 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...l/web/modules/contrib/bootstrap_layouts/src/Plugin/BootstrapLayouts/Ds.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     26 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...tstrap_layouts/src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerBase.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     12 | WARNING | [ ] The class short comment should describe what the class does
        |         |     and not simply repeat the class name
     39 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ules/contrib/bootstrap_layouts/src/Plugin/BootstrapLayouts/PageManager.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     40 | ERROR | [x] Use null coalesce operator instead of ternary operator.
     58 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80).
        |       |     The array content should be split up over multiple lines
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...p_layouts/src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerInterface.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     13 | WARNING | The class short comment should describe what the class does and
        |         | not simply repeat the class name
    --------------------------------------------------------------------------------
    
    
    FILE: ...drupal_local/web/modules/contrib/bootstrap_layouts/src/BootstrapLayout.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------
      10 | WARNING | [ ] The class short comment should describe what the class
         |         |     does and not simply repeat the class name
      91 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     119 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     229 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     244 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ocal/web/modules/contrib/bootstrap_layouts/src/BootstrapLayoutsManager.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      13 | ERROR   | [x] Use statements should be sorted alphabetically. The first
         |         |     wrong one is Drupal\Core\Layout\LayoutPluginManager.
      19 | WARNING | [ ] The class short comment should describe what the class
         |         |     does and not simply repeat the class name
     204 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     279 | WARNING | [ ] Unused variable $handler_id.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 627ms; Memory: 12MB
    
    ➜  contrib git:(main) ✗ 
    

    I will move this to needs work, and also can you make a merge request instead of patch so that the maintainer can easily look at it and merge it when it passes. and another feedback when creating an issue ticket about PHPCS make sure to add more details.

  • 🇮🇳India dev2.addweb

    nilesh.addweb made their first commit to this issue’s fork.

  • Got these issues after applying patch. Please review.

    FILE: /app/modules/contrib/bootstrap_layouts/README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     3 | WARNING | Line exceeds 80 characters; contains 81 characters
    ----------------------------------------------------------------------
    
    
    FILE: /app/modules/contrib/bootstrap_layouts/bootstrap_layouts.install
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ----------------------------------------------------------------------
     66 | ERROR | Inline doc block comments are not allowed; use "/*
        |       | Comment */" or "// Comment" instead
     74 | ERROR | Inline doc block comments are not allowed; use "/*
        |       | Comment */" or "// Comment" instead
    ----------------------------------------------------------------------
    
    
    FILE: /app/modules/contrib/bootstrap_layouts/bootstrap_layouts.module
    ----------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 6 LINES
    ----------------------------------------------------------------------
      64 | ERROR | [x] list(...) is forbidden, use [...] instead.
      91 | ERROR | [x] Use null coalesce operator instead of ternary
         |       |     operator.
      92 | ERROR | [x] Use null coalesce operator instead of ternary
         |       |     operator.
      93 | ERROR | [x] Use null coalesce operator instead of ternary
         |       |     operator.
      94 | ERROR | [x] Use null coalesce operator instead of ternary
         |       |     operator.
     106 | ERROR | [x] Use null coalesce operator instead of ternary
         |       |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: /app/modules/contrib/bootstrap_layouts/src/BootstrapLayout.php
    ----------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    ----------------------------------------------------------------------
      10 | WARNING | [ ] The class short comment should describe what the
         |         |     class does and not simply repeat the class name
      91 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
     119 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
     229 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
     244 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: ...odules/contrib/bootstrap_layouts/src/BootstrapLayoutsManager.php
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------
      13 | ERROR   | [x] Use statements should be sorted alphabetically.
         |         |     The first wrong one is
         |         |     Drupal\Core\Layout\LayoutPluginManager.
      19 | WARNING | [ ] The class short comment should describe what the
         |         |     class does and not simply repeat the class name
     204 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
     279 | WARNING | [ ] Unused variable $handler_id.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: .../contrib/bootstrap_layouts/src/BootstrapLayoutsPluginManager.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------
     65 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     75 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    ----------------------------------------------------------------------
    
    
    FILE: ...rib/bootstrap_layouts/src/BootstrapLayoutsUninstallValidator.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     10 | WARNING | The class short comment should describe what the
        |         | class does and not simply repeat the class name
    ----------------------------------------------------------------------
    
    
    FILE: ...outs/src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerBase.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------
     12 | WARNING | [ ] The class short comment should describe what the
        |         |     class does and not simply repeat the class name
     39 | ERROR   | [x] Use null coalesce operator instead of ternary
        |         |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: ...src/Plugin/BootstrapLayouts/BootstrapLayoutsHandlerInterface.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     13 | WARNING | The class short comment should describe what the
        |         | class does and not simply repeat the class name
    ----------------------------------------------------------------------
    
    
    FILE: ...les/contrib/bootstrap_layouts/src/Plugin/BootstrapLayouts/Ds.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     26 | ERROR | [x] Use null coalesce operator instead of ternary
        |       |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: ...ib/bootstrap_layouts/src/Plugin/BootstrapLayouts/PageManager.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     40 | ERROR | [x] Use null coalesce operator instead of ternary
        |       |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: ...rib/bootstrap_layouts/src/Plugin/Layout/BootstrapLayoutsBase.php
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    ----------------------------------------------------------------------
      11 | ERROR   | [x] Use statements should be sorted alphabetically.
         |         |     The first wrong one is
         |         |     Drupal\Core\Layout\LayoutDefault.
      21 | WARNING | [ ] Possible useless method overriding detected
     153 | ERROR   | [x] Use null coalesce operator instead of ternary
         |         |     operator.
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    Time: 1.67 secs; Memory: 12MB
  • Assigned to dev2.addweb
  • Merge request !6Fixed phpcs issues. → (Open) created by Unnamed author
  • Issue was unassigned.
  • Assigned to dhruv.mittal
Production build 0.71.5 2024