FILE: C:\xampp\htdocs\drupal95\web\modules\contrib\gleab\src\Plugin\Block\GleabBlock.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
25 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
27 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
31 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3305892-14.patch | 7.01 KB | ramonvasconcelos |
| #9 | 3305892-9.patch | 4.59 KB | pflora |
| #7 | 3305892-7.patch | 6.9 KB | pflora |
| #5 | 3305892-5.patch | 6.22 KB | qusai taha |
| #2 | drupal-calls-should-be-avoided-3305892-2.patch | 2.58 KB | Harsh panchal |
Comments
Comment #2
Harsh panchal commentedI have fixed this issue and providing a patch.
Comment #3
bramdriesenMissing types.
Missing return type
better to use single quotes
Comment #4
bramdriesenAlso, instead of concatenating it is possible to use translation parameters to replace a variable in the t string.
Comment #5
qusai taha commentedRe-Roll patch #2
Comment #6
bramdriesenNothing of #3 & #4 has been implemented.
Comment #7
pflora commentedHere's a patch with the requested changes from #3 and #4.
Comment #8
bramdriesenFrist 2 points of #3 still need to be addressed.
protected $configFactory;Should become
protected ConfigFactoryInterface $configFactory;Why is this no longer the ConfigFactoryInterface ?
No need to add this space/tab here
Still missing the return type. I think it should be array in this case.
public function build(): array {Comment #9
pflora commented@BramDriesen Thank you for your feedback!
Here's the patch with the requested changes. Let me know if i could have done anything better!
Comment #10
ramonvasconcelos commentedI'll review it.
Comment #11
ramonvasconcelos commentedThe requests made by @BramDriesen were all done.
Comment #12
bramdriesenContainer interface?
Config !== Container?
Comment #13
ramonvasconcelos commentedSorry i didn't see that. I'll take another look.
Comment #14
ramonvasconcelos commentedChanges done. I corrected the ContainerInterface to ConfigFactoryInterface.
I attached a patch with all the modifications included.
Comment #15
ramonvasconcelos commentedComment #16
alexanderj commentedI will review it.
Comment #17
alexanderj commentedI have reviewed the patch and it is working correctly and I believe it is now as expected. moving to RTBC.
Comment #18
bramdriesenI didn't test the patch but the patch itself code wise looks good now.
Comment #20
ahmad abbad commentedThanks all
Comment #21
ahmad abbad commentedComment #22
ahmad abbad commented