Minor phpcs issues

Created on 4 July 2023, 12 months ago
Updated 28 July 2023, 11 months ago

Problem/Motivation

Upon running the phpcs command, we get four errors in the SaveAllNodesCommands.php file.

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig save_all_nodes-3372194
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\save_all_nodes\src\Commands\SaveAllNodesCommands.php
----------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 10 | WARNING | [x] Unused use statement
 24 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 26 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

RTBC

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

Comments & Activities

  • Issue created by @sidharth_soman
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review 12 months ago
  • Status changed to RTBC 12 months ago
  • 🇦🇷Argentina Zarpele

    The MR solves the cs issues. Please add the command that you are executing in these kinds of issues.

    Before:

    zarpele@machine:~/www/drupal/drupaltest-0623/web/modules/contrib/save_all_nodes (1.x)$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,in,install,test,profile,theme,css,info,txt,md,yml .
    
    FILE: /www/drupal/drupaltest-0623/web/modules/contrib/save_all_nodes/src/Commands/SaveAllNodesCommands.php
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------------------
     10 | WARNING | [x] Unused use statement
     24 | ERROR   | [x] Data types in @var tags need to be fully namespaced
     26 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
    -----------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------
    
    Time: 109ms; Memory: 10MB
    

    After (Empty results):
    zarpele@machine:~/www/drupal/drupaltest-0623/web/modules/contrib/save_all_nodes (3372194-minor-phpcs-issues)$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,in,install,test,profile,theme,css,info,txt,md,yml .

  • 🇮🇳India sidharth_soman Bangalore

    Updated the summary with the command used.

  • Status changed to Needs work 11 months ago
  • 🇨🇦Canada geoanders Nova Scotia 🍁

    Please apply against 2.x branch.

  • Status changed to Needs review 11 months ago
  • 🇮🇳India mrinalini9 New Delhi

    Added patch for 2.x branch, please review it.

    Thanks!

  • Status changed to RTBC 11 months ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I reviewed the changes and confirmed that Patch#8 was applied cleanly to the Save All Nodes module against 2.x-dev on Drupal 9.5.10.

    Checking patch src/Commands/SaveAllNodesCommands.php...
    Applied patch src/Commands/SaveAllNodesCommands.php cleanly.

    And all PHPCS errors have been fixed.

    I ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig save_all_nodes/

    Please see the attached files for reference.

    I'm moving this now to RTBC.

    Thank you!

Production build 0.69.0 2024