Fix the issues reported by phpcs

Created on 18 August 2022, over 2 years ago
Updated 27 June 2024, 5 months ago

Problem/Motivation

FILE: modules/encrypt_seclib/src/Plugin/EncryptionMethod/PHPSecLibEncryption.php
---------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
19 | WARNING | [ ] Line exceeds 80 characters; contains 158 characters
22 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
35 | ERROR | [ ] Missing short description in doc comment
36 | ERROR | [ ] Description for the @return value is missing
45 | ERROR | [ ] Missing short description in doc comment
46 | ERROR | [ ] Description for the @return value is missing
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: modules/encrypt_seclib/src/Tests/PHPSecLibEncryptTest.php
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 5 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
26 | WARNING | [x] '@TODO: remove if https://www.drupal.org/node/2666196 is fixed.' should match the format '@todo Fix problem X here.'
27 | ERROR | [x] You must use "/**" style comments for a member variable comment
27 | ERROR | [ ] Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations.
34 | ERROR | [x] Short array syntax must be used to define arrays
81 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
90 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
91 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
104 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
--------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules/encrypt_seclib/encrypt_seclib.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | "core_version_requirement" property is missing in the info.yml file
6 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-----------------------------------------------------------------------------------------------------------

Time: 134ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Resolve the PHPCS issues.

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India jaydev bhatt Pune, Maharashtra

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

Not all content is available!

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

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC 5 months ago
  • 🇮🇳India dev16.addweb

    I tested the MR !1 and it's working fine. I found no errors or warnings after applying the patch even though I have added a screenshot for the same. please check.

Production build 0.71.5 2024