Minor phpcs issues in Popup.php

Created on 7 July 2023, over 1 year ago
Updated 15 December 2023, 12 months ago

Problem/Motivation

PHPCS throws errors for the Popup.php file as below:

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig popup_field_group
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\popup_field_group\src\Plugin\field_group\FieldGroupFormatter\Popup.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 308 | ERROR   | [ ] Type hint "array" missing for $element
 308 | ERROR   | [ ] Type hint "\Drupal\Core\Form\FormStateInterface" missing for $form_state
 336 | WARNING | [x] '@todo: Check stream wrapper type to prevent using Private and not Local files.' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.64 secs; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

I will provide an MR.

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India sidharth_soman Bangalore

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

Comments & Activities

  • Issue created by @sidharth_soman
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore
  • Status changed to RTBC 12 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied the MR !1 into my local and I confirmed that it fixes the reported PHPCS issue

    āžœ  popup_field_group git:(8.x-1.8) curl https://git.drupalcode.org/project/popup_field_group/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1487  100  1487    0     0   2479      0 --:--:-- --:--:-- --:--:--  2503
    patching file 'src/Plugin/field_group/FieldGroupFormatter/Popup.php'
    āžœ  popup_field_group git:(8.x-1.8) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml popup_field_group 
    āžœ  contrib git:(master) āœ— 
Production build 0.71.5 2024