Problem/Motivation

Currently in the Invite running the phpcs there are a lot of error related to Dependency Injection.

In order to follow the best practice we need to fix them

FILE: invite/src/ParamConverter/InviteParamConverter.php
------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
 27 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------


FILE: invite/src/Form/InviteTypeForm.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 78 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------


FILE: invite/modules/invite_by_email/src/Form/InviteByEmailBlockForm.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
 37 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 60 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------


FILE: invite/modules/invite_link/src/Plugin/Block/InviteLinkBlock.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 25 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs with best practice in the Invite

Proposed resolution

Fix all of them using dependency injection instead of Drupal:: classes.
https://www.hashbangcode.com/article/drupal-9-introduction-services-and-...

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork invite-3276084

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

RenatoG created an issue. See original summary.

renatog’s picture

Issue summary: View changes
renatog’s picture

karanpagare’s picture

Assigned: Unassigned » karanpagare

karanpagare’s picture

Assigned: karanpagare » Unassigned
Status: Active » Needs review

fixed dependency injection issues

ruturaj chaubey’s picture

Status: Needs review » Reviewed & tested by the community

Coding standards relates to Dependency Injection have been applied. Moving to RTBC.

renatog’s picture

Thank you so much for your contribution team

  • RenatoG committed b53c1b2 on 2.0.x authored by karanpagare
    Issue #3276084 by karanpagare, RenatoG, Ruturaj Chaubey: Fix all...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the 2.0.x-dev branch Thanks everyone

  • RenatoG committed dd4aecd on 2.0.x
    Revert "Issue #3276084 by karanpagare, RenatoG, Ruturaj Chaubey: Fix all...

  • RenatoG committed 69a3a30 on 2.0.x
    git commit -m 'Issue #3276084 #3276419 by chakkche, RenatoG: Drupal...

  • RenatoG committed f8b5a4c on 2.0.x
    Issue #3276084 #3276419 by chakkche, RenatoG: Drupal Coding Standards
    

Status: Fixed » Closed (fixed)

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