Problem/Motivation

As per Drupal best practises. "\Drupal calls should be avoided in classes, use dependency injection instead"

Steps to reproduce

Proposed resolution

Use dependency injection for following files.
Sms.php
UserSettingsForm.php

Issue fork twilio-3358358

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

shashank5563 created an issue. See original summary.

shiv_sharma’s picture

Assigned: Unassigned » shiv_sharma

I am checking this issue

kaustab_roy’s picture

StatusFileSize
new3.82 KB

I have a created a patch, review once with it.
Affected files:
Sms.php
UserSettingsForm.php

kaustab_roy’s picture

StatusFileSize
new4.78 KB

Added fixed for the controller issue on send test message sms issue in the patch.
sorry i didn't saw it was already assigned to someone.
Kindly review it as well.

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

nishant’s picture

Assigned: shiv_sharma » nishant

nishant’s picture

Created MR #10, Please review.

shiv_sharma’s picture

Version: 8.x-2.0-alpha9 » 8.x-3.0-alpha7
Status: Needs work » Reviewed & tested by the community

Reviewed the PR #06 working fine on drupal.
Drupal 10.0.9
PHP 8.1.16

shashank5563’s picture

@nishant, can you remove the unused class from UserSettingsForm.php file.

Also, add the Class Constructor description in the file.

  /**
   * Class Constructor.
   *
   */
nishant’s picture

Will do

shashank5563’s picture

Status: Reviewed & tested by the community » Needs work
nishant’s picture

StatusFileSize
new7.01 KB

Created Patch. Please review.

nishant’s picture

Status: Needs work » Needs review

shashank5563’s picture

Version: 8.x-3.0-alpha7 » 8.x-3.0-alpha9
Status: Needs review » Fixed
shashank5563’s picture

Status: Fixed » Closed (fixed)