PHPcs fixes reported the Gitlab CI job

Created on 13 October 2022, about 2 years ago
Updated 27 August 2024, 3 months ago

Problem/Motivation

Check the below CI job and fix those reported in the CI Job.
PHPcs Gitlab CI job: https://git.drupalcode.org/issue/social_media_links-3449085/-/jobs/1657252
๐Ÿ“Œ Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

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

Not all content is available!

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    Issue summary updated

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    I have Fixed The Phpcs error of #6

    remain part is warnings.

    FILE: /home/prem/Documents/drupal11/modules/custom/social_media_links/src/IconsetFinderService.php
    --------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------
     87 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------
    
    
    FILE: ...em/Documents/drupal11/modules/custom/social_media_links/modules/social_media_links_field/src/Plugin/Field/FieldFormatter/SocialMediaLinksFieldDefaultFormatter.php
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     216 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     229 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    It is probably better to first commit ๐Ÿ“Œ Add support for GitLab CI Needs review which would also enable running PHP_CodeSniffer when a merge request is created, or a commit done.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    ankitv18 โ†’ changed the visibility of the branch 3315142-coding-standards-issue to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18
  • Pipeline finished with Success
    6 months ago
    Total: 149s
    #182057
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    Please review MR!39 ~~ All the phpcs errors reported in the gitlab CI are fixed now, phpstan issue is done in https://www.drupal.org/project/social_media_links/issues/3413678 ๐Ÿ“Œ Drupal calls should be avoided in classes, use dependency injection instead Needs review

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @ankitv18,

    I am moving this to 'Needs work', please check the PHPCS issues below after applying the 'MR !39' to the Social Media Links Block and Field module against 8.x-2.x-dev on my D10 local.
    See below:

    FILE: ...roject/DrupalOrg/drupalorgissues/web/modules/contrib/social_media_links/modules/social_media_links_field/src/Plugin/Field/FieldWidget/SocialMediaLinksFieldBaseWidget.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     36 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...upalOrg/drupalorgissues/web/modules/contrib/social_media_links/modules/social_media_links_field/src/Plugin/Field/FieldFormatter/SocialMediaLinksFieldDefaultFormatter.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     218 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     231 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/social_media_links/src/IconsetFinderService.php
    --------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------
     72 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     74 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     89 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------------------------------------

    I ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig social_media_links

    I'm moving this to โ€˜Needs workโ€™ for now.

    Thank you!

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    Thanks @roberttabigue for the review
    Please check the gitlab pipeline:https://git.drupalcode.org/issue/social_media_links-3315142/-/pipelines/...

    Direct drupal calls issues will be fixed as a part of phpstan pipeline.

  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @ankitv18,

    Thank you for responding! I saw that all the PHPCS issues have been resolved here: https://git.drupalcode.org/issue/social_media_links-3315142/-/pipelines/....

    I'm moving this now to 'RTBC'.

    Thank you!

  • First commit to issue fork.
  • Status changed to Closed: outdated 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States japerry KVUO

    Closing since I've already ran the automated phpcs linting process which makes this issue redundant.

Production build 0.71.5 2024