Fix the issues reported by phpcs

Created on 6 July 2022, over 2 years ago
Updated 14 August 2024, 3 months ago
šŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India Harsh panchal

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

Not all content is available!

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

  • Merge request !1Fixing main phpcs errors ā†’ (Open) created by ramonvasconcelos
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • šŸ‡®šŸ‡³India imustakim Ahmedabad

    Issue summary updated.

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India imustakim Ahmedabad
  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    +   * Check if the module exits in the uninstall_unexisting table.
        *
    +   * Create a module folder, .info.yml and .install files for an existing
    +   * module in the uninstall_unexisting table.

    Check and Create must be declined in the third person singular.

        * @param string $module_name
    -   *    A module name.
    -   *
    -   * @return void
    +   *   A module name.

    In parameter descriptions, the definitive article is used, not the indefinite article.

        * @param string $machine_name
    -   *    Machine name of a module.
    +   *   Machine name of a module.

    The correct description is The module machine name. which is the same description used for setNewModule($machine_name).

    -   *    Name of the module to load.
    +   * @param string $module_name
    +   *   Name of the module to load.

    The description is missing the definite article.

    -   *    TRUE is exists, FALSE otherwise.
    +   * @return bool
    +   *   TRUE is exists, FALSE otherwise.

    Since that line is edited, the return value description needs to be corrected too for example to TRUE if the module exists, FALSE otherwise. or TRUE if the module exists.

    -  // Table to store modules information
    +  // Table to store modules information.

    The definite article is missing at the beginning of the description.

    -//  const STATUS_TO_ENABLE = 'to_enable';
    +  // const STATUS_TO_ENABLE = 'to_enable';.

    Periods are not added to commented out code.

    +/**
    + * ServiceClass containing methods for modules manipulation.
    + */

    ServiceClass is not an English word.
    containing methods for modules manipulation is too generic.

    +   * UninstallUnexistingService constructor.
    +   *
    +   * @param \Drupal\Core\Extension\ModuleHandlerInterface $handler
    +   *   The Drupal module handler.
    +   * @param \Drupal\uninstall_unexisting\Service\UninstallUnexistingRepository $uu_repository
    +   *   Contains database helper methods.
    +   * @param \Drupal\Core\Extension\ModuleExtensionList $extension_list_module
    +   *   The Drupal extension list.
    +   */

    The description for a constructor starts with Constructs a new followed by the class name (namespace included), and ends with object.
    It is not necessary to add Drupal in the parameter descriptions.
    $uu_repository is a repository.

    /**
      * @file
    + * Contains the hooks implementations for this module.
      */

    The correct description is Hook implementations for the Uninstall unexisting module.

  • Assigned to nitin_lama
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India nitin_lama India

    Addressed 12.
    12.1 still needs to be addressed. Changes are committed to MR1. Please review.

  • First commit to issue fork.
  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India Yashaswi18

    Addressed 12.1. Please review.

  • Status changed to Needs work 3 months ago
  • Hi @nitin_lama & @Yashaswi18,

    The changes you committed on MR!1 can be applied successfully, however, errors were still reported. Please see below:

    uninstall_unexisting git:(master) āœ— curl https://git.drupalcode.org/project/uninstall_unexisting/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 18960    0 18960    0     0  31839      0 --:--:-- --:--:-- --:--:-- 32354
    patching file src/Service/ModuleHandlerOverride.php
    patching file src/Service/UninstallUnexistingInterface.php
    patching file src/Service/UninstallUnexistingRepository.php
    patching file src/Service/UninstallUnexistingRepositoryInterface.php
    patching file src/Service/UninstallUnexistingService.php
    patching file src/UninstallUnexistingServiceProvider.php
    patching file uninstall_unexisting.install
    patching file uninstall_unexisting.module
    āžœ  uninstall_unexisting git:(master) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig uninstall_unexisting
    
    FILE: ...es/contrib/uninstall_unexisting/src/Service/UninstallUnexistingService.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
    --------------------------------------------------------------------------------
       8 | ERROR   | [x] Use statements should be sorted alphabetically. The first
         |         |     wrong one is Drupal\Core\Extension\Extension.
      62 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
      80 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     102 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     107 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     129 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     133 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
     149 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
         |         |     injection instead
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ninstall_unexisting/src/Service/UninstallUnexistingRepositoryInterface.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     23 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
        |       |     question marks, colons, or closing parentheses
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 255ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Pipeline finished with Success
    3 months ago
    Total: 351s
    #253750
  • Pipeline finished with Success
    3 months ago
    Total: 547s
    #253747
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    avpaderno ā†’ changed the visibility of the branch 3294476-gitlab-ci-reports to hidden.

  • Status changed to Needs review 3 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    3 months ago
    Total: 128s
    #253765
  • Pipeline finished with Success
    3 months ago
    Total: 288s
    #253780
Production build 0.71.5 2024