Fix the issues reported by phpcs

Created on 22 June 2023, over 1 year ago
Updated 17 July 2023, over 1 year ago

----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
9 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Element/EntityAutocomplete.php
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------
10 | WARNING | Line exceeds 80 characters; contains 90 characters
68 | WARNING | Line exceeds 80 characters; contains 100 characters
-----------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Routing/EntityReferencePatternRouteSubscriber.php
------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Missing class doc comment
10 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Controller/EntityAutocompleteController.php
------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
9 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced with use statements
13 | ERROR | [ ] Missing @var tag in member variable comment
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Controller/EntityReferencePatternListBuilder.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
53 | ERROR | [ ] The array declaration extends to column 133 (the limit is 80). The array content should be split up over multiple lines
71 | ERROR | [x] There should be no white space before a closing ")"
79 | ERROR | [x] There should be no white space before a closing ")"
87 | ERROR | [x] There should be no white space before a closing ")"
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Entity/Form/PatternEditForm.php
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------
19 | ERROR | [ ] Missing short description in doc comment
182 | ERROR | [x] Expected 1 space after "=>"; 2 found
202 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/Entity/EntityReferencePatternEntity.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
102 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/EntityReferencePatterns.php
--------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------
20 | ERROR | [ ] Public method name "EntityReferencePatterns::hook_options_list_alter" is not in lowerCamel format
59 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: /home/vishal/Documents/entity_reference_patterns/src/EntityReferencePatternMatcher.php
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------
10 | ERROR | [x] Missing class doc comment
63 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
67 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India vishal365365

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 @vishal365365
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi I reviewed patch #2, and there are still remaining issues reported by phpcs after applying the patch:

    FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/entity_reference_patterns/entity_reference_patterns.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: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/entity_reference_patterns/src/Element/EntityAutocomplete.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------
     10 | WARNING | Line exceeds 80 characters; contains 90 characters
     68 | WARNING | Line exceeds 80 characters; contains 100 characters
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/entity_reference_patterns/src/EntityReferencePatternMatcher.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
     19 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     38 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     48 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     49 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     66 | WARNING | Line exceeds 80 characters; contains 104 characters
     70 | WARNING | Line exceeds 80 characters; contains 86 characters
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/entity_reference_patterns/src/Controller/EntityAutocompleteController.php
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------------
     12 | ERROR | Namespaced classes/interfaces/traits should be referenced with use statements
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/entity_reference_patterns/src/EntityReferencePatterns.php
    ----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------
     20 | ERROR   | Public method name "EntityReferencePatterns::hook_options_list_alter" is not in lowerCamel format
     22 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     23 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     35 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 388ms; Memory: 10MB

    Please check.
    Thank You.

  • Assigned to arti_parmar
  • 🇮🇳India arti_parmar

    yes , I have reviewed and implemented the #patch 2 and its not resolving all the issues.
    still getting error Please see the screenshots attached.
    Thank you

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Issue was unassigned.
  • 🇮🇳India Raveen Kumar

    arti, your patch is having some issues. I am applying the patch using composer but it is saying: - Applying patches for drupal/entity_reference_patterns
    https://www.drupal.org/files/issues/2023-06-23/3368768-6.patch (phpcs)
    Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2023-06-23/3368768-6.patch

    Could you please re-check.

    I applied patch#2, It successfully applied but the phpcs issues were not completely resolved. So i tried your patch but it is giving error.

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India Raveen Kumar

    These are the issues i am getting after applying #2

  • 🇮🇳India roshni27

    I applied patch#2, It successfully applied but the phpcs issues and dependency issues were not completely resolved. So i tried patch #6 but it is giving error.

  • Assigned to roshni27
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India roshni27

    For reading purpose charter limits error remain .Please review the patch.

Production build 0.71.5 2024