Fix the issues reported by phpcs

Created on 11 July 2023, over 1 year ago
Updated 30 July 2024, 4 months ago

Fixed Phpcs issues.

๐Ÿ“Œ Task
Status

RTBC

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
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Provided patch applied cleanly but still found one remaining error.

    Used command.
    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/search_logs

    Remaining errors
    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/search_logs/search_logs.module
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    28 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "search_log_search_api_solr_search_results_alter" but expected
    | | "search_logs_search_log_search_api_solr_search_results_alter"
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Time: 246ms; Memory: 10MB

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mukhtarm

    I think its a typo in the hook implementation. Its implmenting hook_search_api_solr_search_results_alter as mentioned in modules/contrib/search_api_solr/search_api_solr.api.php. please review the patch. thanks

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia pray_12

    Preethy_ray โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India
  • Status changed to RTBC 12 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied patch #5 and I confirmed that it fixes all the PHPCS errors, the remaining issues being flagged in my terminal appears when the module is installed using composer.

    โžœ  search_logs git:(master) โœ— curl https://www.drupal.org/files/issues/2023-11-17/phpcs-fixes-3373765-5.patch | patch -p1  
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  7686  100  7686    0     0  25043      0 --:--:-- --:--:-- --:--:-- 25791
    patching file README.md
    patching file search_logs.module
    patching file 'src/SearchLogger.php'
    โžœ  search_logs git:(master) โœ— ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml search_logs 
    
    FILE: .../Projects/d9/d9-local/web/modules/contrib/search_logs/search_logs.info.yml
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by
       |         | drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" from the info file, it will be added by
       |         | drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by
       |         | drupal.org packaging automatically
    --------------------------------------------------------------------------------
    
    Time: 231ms; Memory: 10MB
    
    โžœ  contrib git:(master) โœ— 
    
  • First commit to issue fork.
  • Merge request !1Fixed the issues reported by phpcs โ†’ (Open) created by realsp
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia realsp

    The patch #5 fixed the phpcs errors (the SearchLogger.php file required Dependency injection included with namespace, and services.yml updated), I've created MR to fix these issues, Please review the MR, Thank you.

  • Status changed to Needs work 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Yashaswi18

    Cloned the repository, checked out to the branch '3373765-fix-the-issues' and ran the command phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml search_logs/

    Found these issues remaining:

    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
       |       |     Drupal\Core\Entity\EntityTypeManagerInterface.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/search_logs/README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
    ----------------------------------------------------------------------
      1 | WARNING | Line exceeds 80 characters; contains 290 characters
      7 | WARNING | Line exceeds 80 characters; contains 81 characters
     11 | WARNING | Line exceeds 80 characters; contains 160 characters
     15 | WARNING | Line exceeds 80 characters; contains 137 characters
     19 | WARNING | Line exceeds 80 characters; contains 97 characters
     21 | WARNING | Line exceeds 80 characters; contains 110 characters
     23 | WARNING | Line exceeds 80 characters; contains 81 characters
     25 | WARNING | Line exceeds 80 characters; contains 95 characters
     31 | WARNING | Line exceeds 80 characters; contains 235 characters
     39 | WARNING | Line exceeds 80 characters; contains 89 characters
     41 | WARNING | Line exceeds 80 characters; contains 164 characters
     45 | WARNING | Line exceeds 80 characters; contains 204 characters
     49 | WARNING | Line exceeds 80 characters; contains 189 characters
     53 | WARNING | Line exceeds 80 characters; contains 120 characters
     57 | WARNING | Line exceeds 80 characters; contains 306 characters
    ----------------------------------------------------------------------
    
    
  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shank115

    Found these issues, hopefully we can ignore them:

    FILE: /home/sites/search_logs/README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
    ----------------------------------------------------------------------
      1 | WARNING | Line exceeds 80 characters; contains 290 characters
      7 | WARNING | Line exceeds 80 characters; contains 81 characters
     11 | WARNING | Line exceeds 80 characters; contains 160 characters
     15 | WARNING | Line exceeds 80 characters; contains 137 characters
     19 | WARNING | Line exceeds 80 characters; contains 97 characters
     21 | WARNING | Line exceeds 80 characters; contains 110 characters
     23 | WARNING | Line exceeds 80 characters; contains 81 characters
     25 | WARNING | Line exceeds 80 characters; contains 95 characters
     31 | WARNING | Line exceeds 80 characters; contains 235 characters
     39 | WARNING | Line exceeds 80 characters; contains 89 characters
     41 | WARNING | Line exceeds 80 characters; contains 164 characters
     45 | WARNING | Line exceeds 80 characters; contains 204 characters
     49 | WARNING | Line exceeds 80 characters; contains 189 characters
     53 | WARNING | Line exceeds 80 characters; contains 120 characters
     57 | WARNING | Line exceeds 80 characters; contains 306 characters
    ----------------------------------------------------------------------
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines cleavinjosh

    Hi @silvi.addweb,

    I applied MR!1, it was applied smoothly and fixed the phpcs issues in the README file.

    โžœ  search_logs curl https://git.drupalcode.org/project/search_logs/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  7379    0  7379    0     0  10015      0 --:--:-- --:--:-- --:--:-- 10012
    patching file README.md
    patching file search_logs.module
    patching file search_logs.services.yml
    patching file src/SearchLogger.php
    โžœ  search_logs ..
    โžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml search_logs
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/search_logs/search_logs.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -------------------------------------------------------------------------------------------------------------
    
    Time: 123ms; Memory: 10MB
    
    โžœ  contrib

    The warnings I found can be ignored since it is because I downloaded the module via composer.

    Thank you.

Production build 0.71.5 2024