I found that in AmazonAuthSettingsForm.php file, there is t() call in class, which is coding standards violation.

$ phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md /c/Bitnami/drupal-8.7.10-0/apps/drupal/htdocs/modules/contrib/social_auth_amazon

FILE: C:\Bitnami\drupal-8.7.10-0\apps\drupal\htdocs\modules\contrib\social_auth_amazon\src\Form\AmazonAuthSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Comments

agrochal created an issue. See original summary.

agrochal’s picture

Status: Active » Needs review
StatusFileSize
new589 bytes

I've created proper patch.

 phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profle,theme,css,info,txt,md /c/Bitnami/drupal-8.7.10-0/apps/drupal/htdocs/modules/contrib/social_auth_amazon


Module is not causing any drupal coding standards violation anymore.

gvso’s picture

Title: t() calls should be avoided in classes » Follow DrupalPractice coding standard

Let's also fix the other issue:

FILE: .../drupal_dev/modules/social_auth_amazon/src/Form/AmazonAuthSettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 90 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...l_projects/drupal_dev/modules/social_auth_amazon/src/AmazonAuthManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 33 | ERROR | The $_GET super global must not be accessed directly; inject the
    |       | request.stack service and use
    |       | $stack->getCurrentRequest()->query->get('code') instead
--------------------------------------------------------------------------------
gvso’s picture

Status: Needs review » Needs work
agrochal’s picture

Status: Needs work » Needs review
StatusFileSize
new2.59 KB

Here's a patch.

artur@DESKTOP-55KMDVT MINGW64 /d/GitHub/social_auth_amazon (8.x-2.x)
$ phpcs --standard=DrupalPractice . /d/GitHub/social_auth_amazon

artur@DESKTOP-55KMDVT MINGW64 /d/GitHub/social_auth_amazon (8.x-2.x)

agrochal’s picture

Status: Needs review » Needs work
urvashi_vora’s picture

Assigned: agrochal » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.7 KB

Hi,

I tried resolving all coding standard issues.

Please review this patch.

Thanks

berramou’s picture

Thank you @agrochal, for your report and thank you @urvashi_vora for the patch.
I reviewed the patch and also add some fixes, It's committed, it will be in the next release.

berramou’s picture

Status: Needs review » Fixed
berramou’s picture

Status: Fixed » Closed (fixed)