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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

SolimanHarkas created an issue. See original summary.

solimanharkas’s picture

Assigned: solimanharkas » Unassigned
Status: Active » Needs review

I fixed all PHPCS errors, Please review my merge request. Thanks

atul_ghate’s picture

Assigned: Unassigned » atul_ghate

I will review this patch.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
StatusFileSize
new7.31 KB
new93.44 KB

Reviewing and applying #3 patch resolved most PHPCS issues, but still some remain, so I am providing a new patch to resolve all PHPCS issues.

akram khan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new42.67 KB
new98.14 KB

Reviewed patch #5 it's apply cleanly and remove all PHPCS errors. Added SS for reference

avpaderno’s picture

Title: PHPCS errors and warnings » Fix the issues reported by phpcs
Status: Reviewed & tested by the community » Needs work
Issue tags: +Coding standards, +Needs issue summary update

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

  • stmh committed 423f51c1 on 8.x-1.x authored by atul ghate
    Issue #3331408 by SolimanHarkas, atul ghate, Akram Khan: Fix the issues...
stmh’s picture

Assigned: Unassigned » stmh

thanks for the patches. Will do some tests before creating a new release.

indrapatil’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update
stmh’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.