Drupal dependency injection

Created on 4 December 2018, over 5 years ago
Updated 14 July 2023, 12 months ago

Problem/Motivation

Drupal and drupal practice asked for dependency injection

Proposed resolution

Injection image factory and use Drupal\Core\StringTranslation\StringTranslationTrait;

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ทBrazil thalles Teรณfilo Otoni - MG

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig image_widget_crop/

    Branch : 8.x-2.x

    FILE: /home/lenovo/d7to9/web/modules/contrib/image_widget_crop/modules/image_widget_crop_examples/src/Form/ImageWidgetCropExamplesForm.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
     116 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
     160 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    FILE: /home/lenovo/d7to9/web/modules/contrib/image_widget_crop/src/ImageWidgetCropManager.php
    ---------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNINGS AFFECTING 1 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------
     189 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------------------------------------------
    

    I am working on it.

  • Issue was unassigned.
  • Status changed to Needs review 12 months ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 12 months ago
    1 pass, 4 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    Please review the patch.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 12 months ago
    1 pass, 4 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    PHP 8.1

Production build 0.69.0 2024