Fix the issues reported by phpcs

Created on 5 January 2023, over 1 year ago
Updated 14 March 2023, over 1 year ago

The followings errors and warnings has been from PHPCS reported

FILE: /externalauth_gitlab/src/Form/SettingsForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------
 10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
 24 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 54 | WARNING | Possible useless method overriding detected
 63 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------


FILE: /externalauth_gitlab/src/Controller/LoginController.php
----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 6 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
   1 | ERROR   | [x] The open comment tag must be the only content on the line
   1 | ERROR   | [ ] Missing short description in doc comment
  19 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  66 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
  68 | WARNING | [ ] Exceptions should not be translated
  72 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 100 | WARNING | [ ] Unused variable $saved_state.
 171 | WARNING | [ ] Exceptions should not be translated
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

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.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany SolimanHarkas

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.

Production build 0.69.0 2024