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
Comments
Comment #3
hmendes commentedCreated a MR with some of the fixes needed.
Missing errors:
Comment #4
elberComment #5
elberHi I just replace the methods mentioned in the comment #3 please revise.
Comment #6
elberComment #7
hmendes commentedComment #8
avpadernoComment #9
avpadernoComment #10
WagnerMelo commentedHi, i'll work on it. XD
Comment #11
WagnerMelo commentedHello, 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.
Comment #12
WagnerMelo commentedI hope helped with my comment.
Comment #14
lucienchalom commentedI 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
Comment #15
elberHi I fixed the tests and finished the dependencies injections.
Comment #16
lucienchalom commentedThank you!
all the coding standards were fixed, and all the tests passing.
Moving to RTBC
Comment #18
paulocsRebasing branch and fixing conflict issues. I have also removed some unnecessary changes.
Comment #19
hmendes commentedThanks :D
Comment #21
hmendes commented