Fix the issues reported by phpcs

Created on 11 July 2023, over 1 year ago
Updated 19 July 2023, over 1 year ago

Problem/Motivation

FILE: ...d_cont/entity_reference_delete_check/src/Service/EntityReferenceUsageChecker.php
--------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------
21 | ERROR | Missing @var tag in member variable comment
26 | ERROR | Missing @var tag in member variable comment
31 | ERROR | Missing @var tag in member variable comment
--------------------------------------------------------------------------------------

FILE: .../vb/d_cont/entity_reference_delete_check/src/Event/DeleteCheckEntityUrlEvent.php
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
20 | ERROR | Missing member variable doc comment
24 | ERROR | Missing @var tag in member variable comment
--------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/entity_reference_delete_check/src/Dto/UsageResult.php
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
20 | ERROR | Missing member variable doc comment
-----------------------------------------------------------------------------------

Time: 92ms; Memory: 10MB

Steps to reproduce

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

Remaining tasks

Patch review

📌 Task
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Assigned to tgauges
  • Issue was unassigned.
  • Status changed to Postponed: needs info over 1 year ago
  • 🇩🇪Germany tgauges

    Thanks for the issue. Sadly I can't replicate the phpcs errors. Which version are you using? This module uses ^3.14 because of compatibility with other development dependencies.
    Also you are removing readonly modifiers in your patch. Is that part of phpcs?

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Because of readonly, it is not identifying the member variable comment.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Also, I got the errors for latest release of the module.

  • 🇩🇪Germany tgauges

    Ah sorry, I mixed up phpcs and php-cs-fixer. I'm also using the latest version of squizlabs/php_codesniffer. Could it be a PHP version mismatch? This module is written for PHP 8.1 or above.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Yes, I am using the same.

  • 🇩🇪Germany tgauges

    Are you using the docker compose service and the composer packages provided in the module source code?
    If not, could you run php -v and composer show drupal/core (for the phpcs rules) in your environment?
    For me its PHP 8.1.18 and versions : * 10.1.1 respectively.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Sure, will send the details, right now I am traveling and my laptop battery is dead.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi @tgauges,

    Here are the details you asked for:

    urvashi@urvashi-vora:/var/www/html/vb/drupal10$ <strong>php -v</strong>
    <strong>PHP 8.1.20</strong> (cli) (built: Jun  8 2023 15:25:40) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.20, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.20, Copyright (c), by Zend Technologies
    urvashi@urvashi-vora:/var/www/html/vb/drupal10$ <strong>composer show drupal/core</strong>
    name     : drupal/core
    descrip. : Drupal is an open source content management platform powering millions of websites and applications.
    keywords : 
    versions : * <strong>10.0.0</strong>
    type     : drupal-core
    
  • 🇩🇪Germany tgauges

    Could you run phpcs --version as well, please? For me it's 3.7.2.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi @tgauges,

    Here is the output for phpcs --version

    urvashi@urvashi-vora:~$ phpcs --version
    PHP_CodeSniffer version 3.7.2 (stable) by Squiz (http://www.squiz.net)
    urvashi@urvashi-vora:~$
  • Status changed to Closed: cannot reproduce over 1 year ago
  • 🇩🇪Germany tgauges

    That's very strange. I'm not getting those errors with the same versions. I'll be closing this issue as not replicable.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Thanks @tgauges

Production build 0.71.5 2024