phpcs --standard=DrupalPractice shows the following report.

FILE: tests/src/Functional/FontYourFaceInstallTest.php
------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 62 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
-------------------------------------------------------


FILE: tests/src/Functional/FontYourFaceSubmoduleInstallTest.php
-------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
-------------------------------------------------------

FILE: tests/src/Functional/FontYourFaceLocalFontInstallTest.php
-------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
    |         | instead
-------------------------------------------------------


FILE: modules/local_fonts/src/Form/LocalFontConfigEntityForm.php
---------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------
 131 | WARNING | File::load calls should be avoided in classes, use dependency injection instead
 139 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 145 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------


FILE: src/Form/FontForm.php
----------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------
 21 | WARNING | Unused variable $entity.
 35 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 41 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------


FILE: src/Form/FontDisplayForm.php
-----------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------
  46 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  56 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 173 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 179 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------


FILE: src/Form/FontSettingsForm.php
-----------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-----------------
  57 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  83 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  86 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 123 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 138 | WARNING | Unused variable $config.
-----------------


FILE: src/Controller/FontYourFaceController.php
----------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
----------------------
  28 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  45 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  58 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  75 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  92 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 105 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------


FILE: src/Plugin/views/filter/FontYourFaceStyleFilter.php
--------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------
 55 | WARNING | Unused variable $exposed.
--------------------------------


FILE: src/Plugin/views/filter/FontYourFaceProviderFilter.php
-----------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------
 44 | WARNING | Unused variable $name.
 47 | WARNING | Unused variable $name.
 59 | WARNING | Unused variable $exposed.
-----------------------------------


FILE: src/Plugin/views/filter/FontYourFaceWeightFilter.php
---------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------
 62 | WARNING | Unused variable $exposed.
---------------------------------

Those files need to be changed to fix the reported issues

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

hmendes created an issue. See original summary.

hmendes’s picture

Assigned: hmendes » Unassigned
Status: Active » Needs work

Created a MR with some of the fixes needed.
Missing errors:

FILE: /modules/fontscom_api/fontscom_api.module
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
 94 | WARNING | Unused variable $key.
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: ./modules/fontsquirrel_api/fontsquirrel_api.module
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
 53 | ERROR | Function zip_open() has been deprecated
 54 | ERROR | Function zip_read() has been deprecated
 55 | ERROR | Function zip_entry_name() has been deprecated
 60 | ERROR | Function zip_entry_read() has been deprecated
 60 | ERROR | Function zip_entry_filesize() has been deprecated
 63 | ERROR | Function zip_entry_close() has been deprecated
 65 | ERROR | Function zip_close() has been deprecated
--------------------------------------------------------
elber’s picture

Assigned: Unassigned » elber
elber’s picture

Assigned: elber » Unassigned
Status: Needs work » Needs review

Hi I just replace the methods mentioned in the comment #3 please revise.

elber’s picture

hmendes’s picture

Status: Needs review » Needs work
avpaderno’s picture

Title: Fix coding standards problems » Fix the issues reported by phpcs
avpaderno’s picture

Issue summary: View changes
WagnerMelo’s picture

Assigned: Unassigned » WagnerMelo

Hi, i'll work on it. XD

WagnerMelo’s picture

Assigned: WagnerMelo » Unassigned

Hello, when I got this problem I noticed that all the errors pointed out by phpcs were resolved in #4, but the tests failed, I tried to solve the tests but now I don't have enough knowledge to solve these errors. And I don't know if it's correct to resolve this test error in this issue or create another one just to solve tests.
If it is necessary to create another issue to resolve the tests, I believe this issue can be moved to RTBC as the phpcs errors are gone.
I'll let this issue in needs works, and waiting someone with more experience to point which is the best way to proceed with that.

WagnerMelo’s picture

I hope helped with my comment.

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

lucienchalom’s picture

I manage to fix most of the errors on test.
The last one that i couldn't fix i reverted the DI, so someone else can do it.
It is in the file fontyourface/modules/local_fonts/src/Form/LocalFontConfigEntityForm.php
and the test is fontyourface/tests/src/Functional/FontYourFaceLocalFontInstallTest.php

elber’s picture

Status: Needs work » Needs review

Hi I fixed the tests and finished the dependencies injections.

lucienchalom’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!
all the coding standards were fixed, and all the tests passing.
Moving to RTBC

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

paulocs’s picture

Status: Reviewed & tested by the community » Needs review

Rebasing branch and fixing conflict issues. I have also removed some unnecessary changes.

hmendes’s picture

Status: Needs review » Reviewed & tested by the community

Thanks :D

  • hmendes committed 42badd9c on 8.x-3.x
    Issue #3332623 by hmendes, elber, lucienchalom, paulocs, WagnerMelo,...
hmendes’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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