Fix the issues reported by phpcs

Created on 11 April 2023, over 1 year ago
Updated 24 July 2024, 5 months ago
šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

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

Merge Requests

Comments & Activities

  • Issue created by @urvashi_vora
  • šŸ‡µšŸ‡­Philippines paraderojether

    I reviewed patch coding-standard-fixes.patch, and there are still remaining errors shown below:

    FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/doi_search/src/Controller/DoiSearchController.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AFFECTING 9 LINES
    ------------------------------------------------------------------------------------------------------------------------
    91 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    110 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    111 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    115 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    146 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    166 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    167 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    168 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    188 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------

    Time: 346ms; Memory: 10MB

    Please check.
    Thank You.

  • šŸ‡®šŸ‡³India Soham Sengupta

    Hi, I have updated the patch with remaining error fixes

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

    Providing interdiff between patch #0 and #3.

    Also, patch #3 looks good to me.

  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
     /**
      * @file
      * Primary module hooks for DOI Publications module.
    - *
    -**/
    + */

    Since that comment is edited, the description for that module is Hook implementations for the DOI Publications module.

       /**
    -   * It takes a DOI and returns an array of reference data
    -   * 
    -   * @param doi The DOI of the reference you want to retrieve.
    -   * 
    -   * @return An array of reference data.
    +   * It takes a DOI and returns an array of reference data.
        */
    -  private function getReferenceData($doi){
    -    if ($doi){
    +  private function getReferenceData($doi) {

    The documentation comment for a method needs to contain the method short description, the parameters description, and the return value description.

  • Assigned to imustakim
  • šŸ‡ØšŸ‡¦Canada imustakim Canada

    Working on this.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡ØšŸ‡¦Canada imustakim Canada

    Patch added.
    Please review.

  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    +   * @return string
    +   *   Returns the title of the publication.

    The return value description must not start with Returns.

    +   * @return string
    +   *   the formatted authors.

    The first word must be capitalized.

  • First commit to issue fork.
  • Assigned to arpitk
  • šŸ‡®šŸ‡³India arpitk

    Working on this.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India arpitk

    Providing the patch including patch #9 and suggestions from @apaderno at #10. Please review the patch.

  • šŸ‡®šŸ‡³India Raveen Kumar

    Hello guys,
    I have reviewed the patch #13 and it seems to be resolving the phpcs issues properly.
    And Thank You.

  • Status changed to Needs work 5 months ago
  • Hi @arpitk,

    Applied the patch you provided, it was applied not-so successfully and errors were still reported. Please see below:

    doi_search git:(1.0.x) āœ— curl https://www.drupal.org/files/issues/2023-05-05/Fixed-the-issues-reported-by-phpcs-3353332-13.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 14347  100 14347    0     0   117k      0 --:--:-- --:--:-- --:--:--  129k
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/README.txt b/README.txt
    |index 2bb2490..6516625 100644
    |--- a/README.txt
    |+++ b/README.txt
    --------------------------
    File to patch: README.md
    patching file README.md
    Hunk #1 FAILED at 7.
    1 out of 1 hunk FAILED -- saving rejects to file README.md.rej
    patching file doi_search.module
    Hunk #1 FAILED at 2.
    Hunk #2 FAILED at 12.
    Hunk #3 FAILED at 57.
    3 out of 3 hunks FAILED -- saving rejects to file doi_search.module.rej
    patching file src/Controller/DoiSearchController.php
    patching file src/DoiSearchManager.php
    patching file src/Form/SearchForm.php
    āžœ  doi_search git:(1.0.x) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig doi_search
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/README.md
    ------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------
     10 | WARNING | Line exceeds 80 characters; contains 99 characters
     14 | WARNING | Line exceeds 80 characters; contains 87 characters
     18 | WARNING | Line exceeds 80 characters; contains 100 characters
    ------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/templates/doi-search-reference.html.twig
    -------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------
     23 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/templates/doi-search-page.html.twig
    --------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------
     20 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/templates/doi-search-result.html.twig
    ----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------
     33 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/doi_search.module
    --------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------
     6 | ERROR | Wrong function doc comment end; expected "*/", found "**/"
    --------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/doi_search/src/Controller/DoiSearchController.php
    -----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\doi_search\DoiSearchManager.
    -----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------
    
    Time: 195ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Merge request !43353332: Fix phpcs issues ā†’ (Open) created by paraderojether
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    avpaderno ā†’ changed the visibility of the branch 3353332-fix-the-issues to hidden.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
Production build 0.71.5 2024