Fix the issues reported by phpcs

Created on 5 July 2023, over 1 year ago
Updated 20 August 2024, 3 months ago

Problem/Motivation

FILE: /home/lenovo/druapl7to9/web/modules/contrib/site_branding_per_role/src/Plugin/Block/SiteBrandingPerRoleBlock.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
  12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Session\AccountInterface.
 184 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

Time: 96ms; Memory: 12MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig site_branding_per_role/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India roshni27

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

  • Issue created by @roshni27
  • Merge request !4fixes issues reported by phpcs ā†’ (Open) created by roshni27
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India roshni27

    Please review MR

  • Status changed to Needs work over 1 year ago
  • @roshni27 , after applying the patch getting this ->

    FILE: C:\xampp\htdocs\project\modules\contrib\site_branding_per_role\site_branding_per_role.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
    1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -------------------------------------------------------------------------------------------------------------

    FILE: C:\xampp\htdocs\project\modules\contrib\site_branding_per_role\src\Plugin\Block\SiteBrandingPerRoleBlock.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
    1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------

    Time: 237ms; Memory: 10MB

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Assigned to nitin_lama
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India roshni27

    @tanuja Make sure you are checking the '3372442-fix-the-issues' branch where the MR is created. I did not getting any warnings.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The content of the .info.yml file is the following.

    name: 'Site Branding Per Role'
    type: module
    description: 'Site branding configuation per role.'
    core_version_requirement: ^8 || ^9 || ^10
    package: 'Site Branding'
    

    It cannot cause the warnings/errors reported in the previous comment.

  • Issue was unassigned.
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡³India nitin_lama India

    There are no errors/warnings left.

  • Status changed to RTBC 3 months ago
  • Hi @everyone,

    Also reviewed MR!4 and confirmed no errors remaining.

    site_branding_per_role git:(2.x) curl https://git.drupalcode.org/project/site_branding_per_role/-/merge_requests/4.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1338    0  1338    0     0   3275      0 --:--:-- --:--:-- --:--:--  3345
    patching file src/Plugin/Block/SiteBrandingPerRoleBlock.php
    āžœ  site_branding_per_role git:(2.x) āœ— .
    .: not enough arguments
    āžœ  site_branding_per_role git:(2.x) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig site_branding_per_role
    āžœ  contrib git:(master) āœ—

    Will now move this to RTBC.

    Thanks,
    Jake

  • Pipeline finished with Failed
    3 months ago
    Total: 36s
    #260071
Production build 0.71.5 2024