Fix coding standards on the Instagram Sync module

Created on 13 February 2025, 2 months ago

Problem/Motivation

It would be great to address the below minor PHPCS issues :

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml instagram_sync/

FILE: /var/www/web/modules/contrib/instagram_sync/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 38 | WARNING | Line exceeds 80 characters; contains 161 characters
 48 | WARNING | Line exceeds 80 characters; contains 88 characters
----------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/instagram_sync/instagram_sync.module
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------
 10 | WARNING | Global constants should not be used, move it to a class or interface
 11 | WARNING | Global constants should not be used, move it to a class or interface
 12 | WARNING | Global constants should not be used, move it to a class or interface
-------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/instagram_sync/src/Plugin/APIType/InstagramLogin.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\Config.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/instagram_sync/src/Form/SettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------
   9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
 272 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/instagram_sync/src/Services/InstagramSyncEntityManager.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\instagram_sync\Entity\InstagramSync.
 100 | ERROR | [x] Expected newline after closing brace
 139 | ERROR | [x] Expected newline after closing brace
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/instagram_sync/src/Services/InstagramSyncService.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\State\StateInterface.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

Time: 675ms; Memory: 12MB

Steps to reproduce

Run the command,
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml instagram_sync/

Proposed resolution

Fix the phpcs issues.

📌 Task
Status

Active

Version

1.1

Component

Code

Created by

🇮🇳India abhiyanshu

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024