Fix the warnings/errors reported by PHP_CodeSniffer

Created on 10 July 2023, over 1 year ago
Updated 29 February 2024, 9 months ago

Problem/Motivation

FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\facets_pretty_paths\src\PrettyPathsActiveFilters.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 111 | WARNING | Unused variable $url_alias.
 184 | ERROR   | The $_REQUEST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('view_path')
     |         | instead
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 444ms; Memory: 12MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig facets_pretty_paths/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

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

Comments & Activities

  • Issue created by @roshni27
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    3 pass, 4 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    Some issues which are better know to maintainer are pending, for reading purpose character limits issues remain and all remaining issues solve by me. Please review the MR.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    Please check on PHP Version PHP 8.1

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines kenyoOwen

    Hi roshni27

    After I applied your patch and run the command there are still warnings present:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml facets_pretty_paths

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/facets_pretty_paths/README.md
    --------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------------------------------
    3 | WARNING | Line exceeds 80 characters; contains 98 characters
    9 | WARNING | Line exceeds 80 characters; contains 83 characters
    33 | WARNING | Line exceeds 80 characters; contains 81 characters
    41 | WARNING | Line exceeds 80 characters; contains 88 characters
    --------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/facets_pretty_paths/src/PrettyPathsActiveFilters.php
    -------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------
    100 | WARNING | Unused variable $url_alias.
    -------------------------------------------------------------------------------------------------------------------------------

    Time: 408ms; Memory: 10MB

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mrinalini9 New Delhi

    Updated patch #2 by addressing #5 all the warnings mentioned in except the unused variable $url_alias warning, so keeping it to Needs Work.

    Thanks!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

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

  • bindu r โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Issue summary updated.

Production build 0.71.5 2024