Fix the issues reported by phpcs

Created on 16 February 2023, over 1 year ago
Updated 5 August 2024, 2 months ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/config/install/core.entity_view_display.node.pokemon.teaser.yml
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------
35 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/config/install/core.entity_view_display.node.pokemon.default.yml
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
34 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/README.md
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 119 characters
6 | WARNING | Line exceeds 80 characters; contains 119 characters
11 | WARNING | Line exceeds 80 characters; contains 111 characters
16 | WARNING | Line exceeds 80 characters; contains 89 characters
-------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/sort/PropertySortTest.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/argument/PropertyArgumentTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/ViewsPluginTestBase.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
27 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/field/PropertyFieldTest.php
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/filter/PropertyFilterTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/query/RemoteDataQueryTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Events/RemoteDataQueryEventTest.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Expected 1 blank line before function; 0 found
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Events/RemoteDataLoadEntitiesEventTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
26 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 119 characters
----------------------------------------------------------------------

Time: 10.38 secs; Memory: 6MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

šŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India samit.310@gmail.com

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 @samit.310@gmail.com
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India samit.310@gmail.com

    Above error/warnings are fixed.

  • Assigned to spriya2896
  • šŸ‡®šŸ‡³India spriya2896

    I will test this patch.

  • šŸ‡®šŸ‡³India spriya2896

    I have tested this patch. This patch was applied successfully and shows no phpcs errors.

  • Issue was unassigned.
  • Status changed to RTBC over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • First commit to issue fork.
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    It would be better that the patch is reviewed by somebody who does not work on the same organization.

  • Status changed to RTBC over 1 year ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    I reviewed patch #2, and verified it fixes the issues reported by the phpcs. Drupal core version 9.5.8, and Views Remote Data 1.0.X-dev.

    I added screenshots for reference.
    Thank You.

  • First commit to issue fork.
  • Merge request !20Issue#3342224: Fixing phpcs issue. ā†’ (Merged) created by ankitv18
  • Status changed to Needs review 4 months ago
  • šŸ‡®šŸ‡³India ankitv18

    @mglaman please review the MR!20

  • Pipeline finished with Success
    4 months ago
    Total: 177s
    #206991
  • Pipeline finished with Success
    4 months ago
    Total: 177s
    #208261
  • Status changed to Needs work 3 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied the updated MR !20 after commit #14 and I can still see many PHPCS issues:

    āžœ  views_remote_data git:(1.0.x) curl https://git.drupalcode.org/project/views_remote_data/-/merge_requests/20.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6783    0  6783    0     0  13277      0 --:--:-- --:--:-- --:--:-- 13647
    patching file 'tests/src/Kernel/Events/RemoteDataQueryEventTest.php'
    patching file 'tests/src/Kernel/Plugin/views/ViewsPluginTestBase.php'
    patching file 'tests/src/Kernel/Plugin/views/argument/PropertyArgumentTest.php'
    patching file 'tests/src/Kernel/Plugin/views/field/PropertyFieldTest.php'
    patching file 'tests/src/Kernel/Plugin/views/filter/PropertyFilterTest.php'
    patching file 'tests/src/Kernel/Plugin/views/query/RemoteDataQueryTest.php'
    patching file 'tests/src/Kernel/Plugin/views/sort/PropertySortTest.php'
    āžœ  views_remote_data git:(1.0.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml views_remote_data 
    
    FILE: ...ta_pokeapi/config/install/core.entity_view_display.node.pokemon.teaser.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     35 | ERROR | [x] Expected 1 newline at end of file; 2 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...a_pokeapi/config/install/core.entity_view_display.node.pokemon.default.yml
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     34 | ERROR | [x] Expected 1 newline at end of file; 2 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...ontrib/views_remote_data/tests/modules/views_remote_data_pokeapi/README.md
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      5 | WARNING | Line exceeds 80 characters; contains 119 characters
      6 | WARNING | Line exceeds 80 characters; contains 119 characters
     11 | WARNING | Line exceeds 80 characters; contains 111 characters
     16 | WARNING | Line exceeds 80 characters; contains 89 characters
    --------------------------------------------------------------------------------
    
    
    FILE: ...ws_remote_data/tests/src/Kernel/Events/RemoteDataLoadEntitiesEventTest.php
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
      8 | ERROR | [x] Use statements should be sorted alphabetically. The first
        |       |     wrong one is Drupal\Component\Serialization\Json.
     26 | ERROR | [x] Expected 1 blank line before function; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: .../Projects/d10/drupal_local/web/modules/contrib/views_remote_data/README.md
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     5 | WARNING | Line exceeds 80 characters; contains 119 characters
    --------------------------------------------------------------------------------
    
    Time: 754ms; Memory: 12MB
    
    āžœ  contrib git:(main) āœ— 
    
  • Pipeline finished with Success
    3 months ago
    Total: 183s
    #230311
  • Pipeline finished with Canceled
    3 months ago
    Total: 101s
    #230317
  • Pipeline finished with Success
    3 months ago
    Total: 155s
    #230318
  • Status changed to Needs review 3 months ago
  • šŸ‡®šŸ‡³India ankitv18

    Rebased and made minor changes to make pipelines green for all.

  • Pipeline finished with Success
    3 months ago
    #231259
  • šŸ‡ŗšŸ‡øUnited States mglaman WI, USA
  • šŸ‡ŗšŸ‡øUnited States mglaman WI, USA
  • Pipeline finished with Skipped
    3 months ago
    #231310
  • Status changed to Fixed 3 months ago
  • šŸ‡ŗšŸ‡øUnited States mglaman WI, USA
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024