FILE: C:\xampp\htdocs\drupal95\web\modules\contrib\gantt\src\Form\AddComponentForm.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------
81 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
130 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
227 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
230 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
283 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3310638-7.patch | 1.97 KB | ramonvasconcelos |
| #2 | Drupal-call-should-be-avoided-3310638-2.patch | 3.6 KB | akshay.kelotra |
Comments
Comment #2
akshay.kelotra commentedI have fixed this issue and providing a patch.
Comment #3
alexanderj commentedI will review it.
Comment #4
alexanderj commentedI have reviewed your patch and it fixes all the errors pointed out in the issue summary, but there are still 2 DI warnings in another file
gantt/src/Controller/GanttController.php, I believe they can be fixed:Comment #6
ramonvasconcelos commentedI can fix the last 2 errors.
Comment #7
ramonvasconcelos commentedJust added the dependency injection for these 2 cases. Please, review it.
Comment #8
ramonvasconcelos commentedComment #9
pflora commentedPatch from #8 applies and after running phpcs there are no more dependency injection errors in the GanttController.php file.
Moving this to RTBC.
Comment #11
lazzyvn commented