Fix the issues reported by phpcs

Created on 24 March 2023, over 1 year ago
Updated 20 May 2023, over 1 year ago

Problem/Motivation

Getting the following errors/warnings.

FILE: /enable_disable_node_toggle/enable_disable_node_toggle.libraries.yml
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 12 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: /enable_disable_node_toggle/enable_disable_node_toggle.routing.yml
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /enable_disable_node_toggle/src/Controller/ChangeNodeStatus.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 25 | WARNING | Node::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------

Steps to reproduce

Run following command

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml enable_disable_node_toggle

Proposed resolution

The above errors need to be fixed.

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia omkar_yewale Mumbai

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 @omkar_yewale
  • @omkar_yewale opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia omkar_yewale Mumbai

    Please review the patch and !2 MR.

  • Issue was unassigned.
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines kenyoOwen

    Hi omkar_yewale

    I applied patch #3 to the โ€œEnable/Disable Node Status Toggle Buttonโ€ module against Version 1.0.x-dev and confirmed that the errors and warning are resolved. Please see the screenshots attached.

    For your review.
    Thank you.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    +  /**
    +   * Constructs a new ChangeNodeStatus.
    +   *

    The description for a constructor must start with Constructs a new followed by the class name (including its namespace), and end with object.

  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia bharath-kondeti Hyderabad

    Addressed #5. Putting a namespace in comment is giving more than 80 characters issue.

Production build 0.71.5 2024