Fix consultation phpcs CI warnings.

Created on 22 February 2024, 4 months ago
Updated 27 June 2024, 1 day ago

Problem/Motivation

There are phpcs warnings for the CI pipeline:

https://git.drupalcode.org/project/consultation/-/jobs/884281

Steps to reproduce

Proposed resolution

Fix phpcs issue.

Remaining tasks

  • Update code
  • Review and test
  • Commit

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Kristen Pol
  • First commit to issue fork.
  • Merge request !10addressed code style warnings / errors → (Open) created by D-XPERT
  • Pipeline finished with Success
    4 months ago
    Total: 164s
    #106641
  • Pipeline finished with Success
    4 months ago
    Total: 163s
    #106669
  • Assigned to apatel0325
  • Issue was unassigned.
  • Pipeline finished with Success
    3 months ago
    Total: 147s
    #122319
  • 🇮🇳India Jasjeet Kaur Brar

    @apatel, still has warning for phpcs

  • Pipeline finished with Success
    3 months ago
    Total: 148s
    #122344
  • Pipeline finished with Success
    3 months ago
    Total: 144s
    #122348
  • Pipeline finished with Success
    3 months ago
    Total: 156s
    #122351
  • Pipeline finished with Success
    3 months ago
    Total: 252s
    #122355
  • Pipeline finished with Success
    3 months ago
    #122362
  • Pipeline finished with Success
    3 months ago
    Total: 268s
    #122370
  • 🇮🇳India Jasjeet Kaur Brar

    @Kristen Pol, Finally phpcs has green tick across board. Please review. And Thank you.

  • Status changed to Needs review 3 months ago
  • Status changed to Needs work 1 day ago
  • 🇮🇳India dev16.addweb

    Hello,

    I have tested the MR !10 and I found some errors and warnings after applying the patch.

    FILE: /home/addweb/patches/consultation-3423317/src/Plugin/WebformHandler/ConsultationNotify.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     54 | ERROR | The $_POST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('form_id') instead
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/patches/consultation-3423317/src/Plugin/views/filter/ConsultationState.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     21 | WARNING | Unused variable $operators.
    ---------------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/patches/consultation-3423317/src/ConsultationNodeHelper.php
    ------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------
     134 | WARNING | Unused variable $end.
    ------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/patches/consultation-3423317/src/ConsultationUninstallValidator.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     28 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/patches/consultation-3423317/consultation.module
    -------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    -------------------------------------------------------------------------------------
     17 | WARNING | Global constants should not be used, move it to a class or interface
     21 | WARNING | Global constants should not be used, move it to a class or interface
     25 | WARNING | Global constants should not be used, move it to a class or interface
     28 | WARNING | Global constants should not be used, move it to a class or interface
    -------------------------------------------------------------------------------------
    
    Time: 426ms; Memory: 12MB
    
    
Production build 0.69.0 2024