Problem/Motivation

There are a lot of errors and warnings about indentation, blank lines, whitespace etc.

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

Rajeshreeputra created an issue. See original summary.

mohit.bansal623’s picture

Did you left anything in that patch?

rajeshreeputra’s picture

hello @mohit.bansal623,
Yes few things are still there which need to take care of, didn't getting enough time to work on those. Almost 80% to 85% of PHPCS issues are fixed in the provided patch.

sourabhjain’s picture

Status: Active » Needs review
StatusFileSize
new24.93 KB

Resolved all the PHPCS issues. Please review.

hmendes’s picture

Status: Needs review » Needs work

Still missing these errors when running phpcs

FILE: /src/Plugin/GamificationWidgetBase.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 181 | ERROR | Arguments with default values must be at the end of the argument list
--------------------------------------------------------------------------------------------------------


FILE: /src/Plugin/GamificationWidgetManager.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 152 | ERROR | Arguments with default values must be at the end of the argument list
--------------------------------------------------------------------------------------------------------


FILE: /src/GamificationInterface.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 11 | ERROR | Class constants must be uppercase; expected GAMIFICATION but found gamification
--------------------------------------------------------------------------------------------------------

FILE: /src/Form/GamificationForm.php
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------
 147 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 148 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 175 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 177 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 191 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 193 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
--------------------------------------------------------------------------------------------------------


FILE: /src/Plugin/GamificationWidgetBase.php
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 183 | WARNING | Unused variable $result.
--------------------------------------------------------------------------------------------------------

rajeshreeputra’s picture

It's been covered in the patch provided in the description.

@sourabhjain, could you please combine both the patches.

Thanks,
Rajeshreeputra

andregp’s picture

I'll combine the patches and check if anything else is missing

andregp’s picture

Assigned: Unassigned » andregp
andregp’s picture

Assigned: andregp » Unassigned
Status: Needs work » Needs review
StatusFileSize
new27.62 KB

I applied the patch from @sourabhjain to the code (which had less phpcs errors remaining) and made the remaining changes consulting @rajeshreeputra patch. Although, there was still two phpcs errors that neither of them addressed (from GamificationInterface.php and GamificationWidgetBase.php), but they were easy to fix.

anagomes’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #9 applies just fine, and corrects every error and warning pointed by PHPCS before the patch was applied.

avpaderno’s picture

Version: 1.0.0 » 1.0.x-dev
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.

avpaderno’s picture

Title: PHPCS Issues to be fixed » Fix the issues reported by phpcs
indrapatil’s picture

Issue summary: View changes
avpaderno’s picture

Priority: Normal » Minor

kkalashnikov made their first commit to this issue’s fork.

kunalgautam’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work

The status is also for the issue summary, which needs to be updated.

joaomarques736’s picture

Status: Needs work » Fixed
joaomarques736’s picture

Status: Fixed » Closed (fixed)