Problem/Motivation
remove WARNING \Drupal calls should be avoided in classes, use dependency injection instead
Steps to reproduce
Run the command:
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml instagram_posts_block/
Proposed resolution
Fix the following coding standards issues and upload the patch or create an MR with fixes.
FILE: C:\xampp\htdocs\drupal_9\web\modules\contrib\instagram_posts_block\src\Plugin\Block\InstagramPostsBlock.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
82 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | phpcs-issue-fixes-3363538-4.patch | 7.86 KB | ashutosh ahirwal |
| #3 | applying patch.png | 190.35 KB | kenyoowen |
| #2 | use-dependency-injection-3363538-2.patch | 5.1 KB | arti_parmar |
Issue fork instagram_posts_block-3363538
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
Comment #2
arti_parmar commentedKindly review patch.
Comment #3
kenyoowen commentedHi arti_parmar
I applied your patch in two ways which are git apply and patch -p1 and both have an error. Please see the screenshots attached.
Thank you.
Comment #4
ashutosh ahirwal commentedProviding new patch with phpcs issue fixes.
using phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/custom/instagram_posts_block
Comment #6
ahmad abbad commentedMerged, Thank you
Comment #7
ahmad abbad commentedComment #9
ahmad abbad commentedComment #10
ahmad abbad commented@Ashutosh Ahirwal The block is not functioning correctly after applying the patch.
Comment #12
ahmad abbad commented