Fix the issues reported by phpcs

Created on 21 July 2023, over 1 year ago
Updated 25 July 2023, over 1 year ago

Problem/Motivation

FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/merlinone.install
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------
  24 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 158 | ERROR   | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/merlinone.module
------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Form/MerlinOneBulkAddForm.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
 12 | ERROR | [x] Doc comment short description must end with a full stop
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Traits/MerlinOneBrowserTrait.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------
  6 | WARNING | [x] Unused use statement
 39 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 62 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 68 | ERROR   | [x] Data types in @var tags need to be fully namespaced
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Traits/MerlinOneMediaSourceTrait.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------
  55 | ERROR | [x] Use null coalesce operator instead of ternary operator.
  58 | ERROR | [x] Use null coalesce operator instead of ternary operator.
  60 | ERROR | [x] There must be no space before the colon in a CASE statement
 113 | ERROR | [x] Case breaking statement indented incorrectly; expected 10 spaces, found 8
 116 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Plugin/EntityBrowser/Widget/MerlinOneSearch.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 139 | ERROR   | [x] Doc comment short description must end with a full stop
 141 | ERROR   | [ ] Missing parameter comment
 141 | ERROR   | [ ] Missing parameter type
 142 | ERROR   | [ ] Missing parameter comment
 143 | ERROR   | [ ] Missing parameter comment
 143 | ERROR   | [ ] Missing parameter type
 164 | ERROR   | [ ] Missing parameter comment
 165 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 165 | ERROR   | [ ] Description for the @return value is missing
 202 | WARNING | [ ] Media::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Plugin/media/Source/MerlinOneMediaSourceInterface.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 18 | ERROR | [x] Separate the @param and @return sections by a blank line.
 26 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 30 | ERROR | [x] Separate the @param and @return sections by a blank line.
 30 | ERROR | [ ] Description for the @return value is missing
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/MerlinOneApi.php
----------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------
  40 | ERROR   | [ ] Missing short description in doc comment
  59 | ERROR   | [ ] Parameter $imageFactory is not described in comment
 125 | WARNING | [ ] Line exceeds 80 characters; contains 145 characters
 128 | ERROR   | [x] Expected one space after the comma, 0 found
 137 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 175 | ERROR   | [x] Expected one space after the comma, 0 found
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Controller/MerlinOnePrepareMediaController.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  20 | ERROR | Missing short description in doc comment
  32 | ERROR | Missing short description in doc comment
  87 | ERROR | Description for the @return value is missing
 125 | ERROR | Missing parameter comment
 125 | ERROR | Missing parameter type
----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Controller/MerlinOneFinalizeMediaController.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
  21 | ERROR   | [ ] Missing short description in doc comment
  95 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
  99 | ERROR   | [ ] Missing parameter type
 101 | ERROR   | [ ] Missing parameter type
 104 | ERROR   | [ ] Description for the @return value is missing
 113 | WARNING | [ ] Media::load calls should be avoided in classes, use dependency injection instead
 127 | ERROR   | [x] Expected one space after the comma, 0 found
 131 | ERROR   | [x] Expected one space after the comma, 0 found
 164 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 170 | WARNING | [ ] ImageStyle::loadMultiple calls should be avoided in classes, use dependency injection instead
 171 | ERROR   | [x] Data types in @var tags need to be fully namespaced
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/merlinone/src/Controller/MerlinOneBulkAddController.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
-----------------------------------------------------------------------------------------------------------------------------------
  16 | ERROR | [x] Doc comment short description must end with a full stop
  98 | ERROR | [ ] Description for the @return value is missing
  99 | ERROR | [x] Separate the @return and @throws sections by a blank line.
 126 | ERROR | [ ] Description for the @return value is missing
 153 | ERROR | [ ] Description for the @return value is missing
 154 | ERROR | [x] Separate the @return and @throws sections by a blank line.
 161 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 173 | ERROR | [x] Expected 1 blank line after function; 0 found
 174 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

Time: 338ms; Memory: 10MB

Steps to reproduce

Please execute this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig merlinone/

📌 Task
Status

RTBC

Version

3.2

Component

Code

Created by

🇵🇭Philippines roberttabigue

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @roberttabigue
  • First commit to issue fork.
  • @bharath-kondeti opened merge request.
  • Assigned to imustakim
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India imustakim Ahmedabad

    Only this error is remaining because of class namespace in constructor description, Assuming this can be ignored.
    MR Updated, Please review.

    FILE: /Users/specbee/Sites/Projects/merlinone-3376138/src/Plugin/EntityBrowser/Widget/MerlinOneSearch.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
     36 | WARNING | Line exceeds 80 characters; contains 91 characters
    ---------------------------------------------------------------------------------------------------------
    
    Time: 362ms; Memory: 10MB
    
  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I applied the MR !1 to the MerlinOne module against 3.2.0 on Drupal 9.5.10 and confirmed only the 1 Warning mentioned by imustakim remains.

    I re-ran this command:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig merlinone/

    Please see the attached file for reference.

    I'm moving this now to RTBC.

    Thank you!

Production build 0.71.5 2024