Unused variable $config

Created on 28 June 2022, over 2 years ago
Updated 21 March 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/web/modules/custom/menu_item_role_access/menu_item_role_access.module
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
 24 | WARNING | Unused variable $config.
-----------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/menu_item_role_access/src/Form/ConfigForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/menu_item_role_access/src/MenuItemRoleAccessLinkTreeManipulator.php
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
 79 | WARNING | MenuLinkContent::load calls should be avoided in classes, use dependency injection instead
 91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------
📌 Task
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇮🇳India Ashutosh Ahirwal India

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

Comments & Activities

Not all content is available!

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

  • 🇮🇳India arunkumark Coimbatore

    I tested the patch working as expected to remove the unused variable $config.

    Before applying patch:

    After applying patch:

    But there are a few other warnings. It would be great we are resolving all the warning errors.

    Warnings are,

    FILE: /var/www/html/web/modules/custom/menu_item_role_access/src/Form/ConfigForm.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/modules/custom/menu_item_role_access/src/MenuItemRoleAccessLinkTreeManipulator.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------
     79 | WARNING | MenuLinkContent::load calls should be avoided in classes, use dependency injection instead
     91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    -----------------------------------------------------------------------------------------------------------
  • Fixes PHPCS issues and created patch

  • Status changed to Closed: duplicate over 1 year ago
  • 🇮🇳India hardikpandya

    This would be covered as part of https://www.drupal.org/project/menu_item_role_access/issues/3293109 🐛 Fix the issues reported by phpcs Needs review where more work for fixing all phpcs issues is being done. Closing this!

Production build 0.71.5 2024