FILE: /var/www/html/contribution/web/modules/contrib/mail_login/src/AuthDecorator.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 6 WARNINGS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
37 | ERROR | Parameter $entity_type_manager is not described in comment
42 | ERROR | Doc comment for parameter $entity_type_managerk does not match actual variable name $connection
57 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
70 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
80 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
88 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/web/modules/contrib/mail_login/src/Form/MailLoginAdminSettingsForm.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
31 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/web/modules/contrib/mail_login/README.md
-------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------
48 | WARNING | Line exceeds 80 characters; contains 85 characters
-------------------------------------------------------------------------

Issue fork mail_login-3342236

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

himanshu_jhaloya created an issue. See original summary.

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
Status: Active » Needs review
Sonal Gyanani’s picture

Assigned: Unassigned » Sonal Gyanani
Sonal Gyanani’s picture

Assigned: Sonal Gyanani » Unassigned
Status: Needs review » Reviewed & tested by the community

Thanks @himanshu_jhaloya, MR looks good all errors and warnings are fixed now.
So moving it to RTBC

avpaderno’s picture

Version: 8.x-2.7 » 8.x-2.x-dev
Status: Reviewed & tested by the community » Needs work
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Core\Config\ConfigFactoryInterface;

use statements are alphabetically ordered.

-    $config = \Drupal::service('config.factory')->getEditable('mail_login.settings');
+    $config = $this->configFactory->getEditable('mail_login.settings');

The parent class has the config() method that code should use.

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

avpaderno’s picture

Title: Drupal Coding standard issue » Fix the issues reported by phpcs
Priority: Normal » Minor
+  /**
+   * The Config Form.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The config factory.
+   */
+  public function __construct(ConfigFactoryInterface $config_factory) {
+    $this->configFactory = $config_factory;

The short description for a constructor starts with Constructs a new and ends with the class name (namespace included) and object.

   public function buildForm(array $form, FormStateInterface $form_state) {
-    $config = \Drupal::service('config.factory')->getEditable('mail_login.settings');
+    $config = $this->configFactory->getEditable('mail_login.settings');

A class that extends ConfigFormBase uses $this->config().

himanshu_jhaloya’s picture

Status: Needs work » Needs review

  • mqanneh committed 929c4fa9 on 8.x-2.x
    Issue #3342236 by himanshu_jhaloya, mqanneh, Sonal Gyanani, apaderno:...
mqanneh’s picture

Status: Needs review » Fixed

The merge requests branches have conflicts with t=8.x-2.x branch. I had to rewrite the patches.

mqanneh’s picture

Status: Fixed » Closed (fixed)