Fix the issues reported by phpcs

Created on 10 February 2023, almost 2 years ago
Updated 16 August 2024, 3 months ago
📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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 @sidharth_soman
  • Status changed to Needs work almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    Finding the following issues.

    C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig modal_blocks-3340805
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\modal_blocks-3340805\css\modal_block.css
    ----------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\modal_blocks-3340805\modal_blocks.module
    ----------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
      3 | ERROR | [x] You must use "/**" style comments for a file comment
     23 | ERROR | [x] The open comment tag must be the only content on the line
     23 | ERROR | [x] Doc comment short description must be on the first line
     23 | ERROR | [ ] Doc comment short description must start with a capital letter
    ----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\modal_blocks-3340805\README.md
    ------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------
     39 | WARNING | Line exceeds 80 characters; contains 87 characters
    ------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\modal_blocks-3340805\src\Plugin\Block\ModalBlock.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
    ----------------------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
     109 | ERROR   | [x] Case breaking statements must be followed by a single blank line
     112 | ERROR   | [x] Case breaking statements must be followed by a single blank line
     115 | ERROR   | [x] Case breaking statements must be followed by a single blank line
     122 | WARNING | [ ] Block::load calls should be avoided in classes, use dependency injection instead
     123 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------
    
    Time: 529ms; Memory: 6MB
    

    I will work on solving them.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    All issues solved except dependency injection. Please review.

  • @rashmisoni opened merge request.
  • 🇮🇳India rassoni Bangalore

    The patch applies cleanly and all PHPCS issues are resolved .

  • 🇮🇳India saket-001

    Applying patch #3 it solve the phpcs issue .

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India saket-001

    No error is there but there is some warning after the patch applied for version 9.x

  • 🇮🇳India rassoni Bangalore
  • 🇮🇳India rassoni Bangalore
  • First commit to issue fork.
  • Merge request !93340805: phpcs more fixes → (Open) created by kkalashnikov
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    Providing patch for review.
    Thanks.

  • 🇮🇳India saket-001

    @Ashutosh Ahirwal thanks for the patch and also its working fine but there is just some warning for whitespaces .

  • 🇮🇳India Mahima_Mathur23

    @Ashutosh Ahirwal,
    Can you also attach an interdiff that is there with the previous patch.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -/*
    +/**
      * @file
      * Provides a Modal Block.
      */

    Since that comment is edited, the short description needs to be edited too: It needs to be Hook implementations for the Modal Blocks module.

    +  /**
    +   * Constructs a UserApprovalForm object.
    +   *
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    +   *   The entity type manager.
    +   */
    +  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    +    $this->entityTypeManager = $entity_type_manager;
    +  }

    The class short description must include the class namespace.

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India sakthi_dev

    Addressed the comments in #16. Please review.

  • Status changed to RTBC 3 months ago
  • Hi @everyone,

    The changes made on the MR !9 were confirmed addressed #16's comments. Please see attached image.

    Will now move this to RTBC

    Thanks,
    Jake

  • Pipeline finished with Success
    3 months ago
    Total: 302s
    #255735
  • Assigned to apaderno
  • Status changed to Needs work 3 months ago
  • Pipeline finished with Success
    3 months ago
    Total: 252s
    #255742
  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Pipeline finished with Success
    3 months ago
    Total: 285s
    #255749
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    avpaderno → changed the visibility of the branch 3340805-gitlab-ci-reports to hidden.

Production build 0.71.5 2024