Fix the issues reported by phpcs

Created on 16 December 2022, about 2 years ago
Updated 10 April 2024, 10 months ago

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\facets.install
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
95 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\modules\facets_summary\src\Plugin\Block\FacetsSummaryBlock.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
154 | ERROR | Missing short description in doc comment
------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\modules\facets_summary\src\Plugin\views\filter\FacetsSummaryFilter.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
28 | ERROR | Class property $no_operator should use lowerCamel naming without underscores
--------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
33 | WARNING | Line exceeds 80 characters; contains 91 characters
----------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Entity\Facet.php
------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------
318 | ERROR | Missing member variable doc comment
1199 | ERROR | Doc comment is empty
------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Event\GetFacetCacheContexts.php
---------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------
37 | ERROR | Type hint "array" missing for $cacheContexts
58 | ERROR | Type hint "array" missing for $cacheContexts
---------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Event\GetFacetCacheTags.php
-----------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------
37 | ERROR | Type hint "array" missing for $cacheTags
58 | ERROR | Type hint "array" missing for $cacheTags
-----------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Event\PostBuildFacet.php
-------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
49 | ERROR | If there is no return value for a function, there must not be a @return tag.
49 | ERROR | Description for the @return value is missing
-------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\FacetManager\DefaultFacetManager.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
374 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Form\FacetForm.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
149 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Plugin\better_exposed_filters\filter\Facets.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
74 | ERROR | Doc comment is empty
-------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Plugin\Block\FacetBlock.php
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------
41 | ERROR | Missing short description in doc comment
99 | WARNING | Unused variable $facet_source.
-----------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Plugin\facets\facet_source\SearchApiDisplay.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
91 | ERROR | Class property $display_edit_in_progress should use lowerCamel naming without underscores
184 | ERROR | The $_REQUEST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('view_args') instead
577 | ERROR | Description for the @return value is missing
586 | ERROR | Missing parameter comment
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Plugin\views\filter\FacetsFilter.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
29 | ERROR | Class property $no_operator should use lowerCamel naming without underscores
--------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\src\Utility\FacetsUrlGenerator.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
149 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\tests\src\Functional\Rest\FacetResourceTestBase.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
123 | ERROR | Description for the @return value is missing
-------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\tests\src\Functional\WidgetIntegrationTest.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------
253 | WARNING | Line exceeds 80 characters; contains 143 characters
254 | ERROR | Doc comment short description must end with a full stop
254 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
261 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
267 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\facets\tests\src\Unit\Plugin\processor\ListItemProcessorTest.php
-------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
45 | ERROR | Missing member variable doc comment
45 | ERROR | Class property $processor_plugin_manager should use lowerCamel naming without underscores
-------------------------------------------------------------------------------------------------------------------

๐Ÿ“Œ Task
Status

Closed: outdated

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia anoopsingh92 Rajasthan, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • @gun2dru opened merge request.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore

    Rashmisoni โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore

    Merge request resolve errors above but found few more issues.

    FILE: /Users/rashmi.krishnachand/projects/drupal-d10/modules/contrib/facets/tests/src/Unit/Plugin/processor/ListItemProcessorTest.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
    50 | ERROR | Class property $processor_plugin_manager should use lowerCamel naming without underscores
    -------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/rashmi.krishnachand/projects/drupal-d10/modules/contrib/facets/README.md
    -------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------
    33 | WARNING | Line exceeds 80 characters; contains 91 characters
    -------------------------------------------------------------------------------------

    FILE: /Users/rashmi.krishnachand/projects/drupal-d10/modules/contrib/facets/modules/facets_summary/src/Plugin/views/filter/FacetsSummaryFilter.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
    30 | ERROR | Class property $no_operator should use lowerCamel naming without underscores
    --------------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/rashmi.krishnachand/projects/drupal-d10/modules/contrib/facets/src/Plugin/views/filter/FacetsFilter.php
    --------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------
    29 | ERROR | Class property $no_operator should use lowerCamel naming without underscores
    --------------------------------------------------------------------------------------------------------------------

    Time: 2.6 secs; Memory: 16MB

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Adil_Siddiqui

    Patch created for all the above phpcs issues

  • The last submitted patch, 12: 3327592-12.patch, failed testing. View results โ†’
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Assigned to arpitk
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arpitk

    Hi, running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .
    After applying patch #12 returns these errors.

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/facets/src/Plugin/views/FacetsViewsPluginTrait.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
     41 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ---------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/facets/facets.install
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
     95 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/facets/modules/facets_summary/src/Plugin/views/FacetsSummaryViewsPluginTrait.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
     40 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ---------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/facets/modules/facets_summary/src/Plugin/facets_summary/processor/ShowCountProcessor.php
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------------
     34 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    -----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------

    Moving to needs work and working on remaining issues.

    Thanks!

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org โ†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arpitk

    Here is the updated patch. Please review.

    Thanks!

  • Status changed to Closed: outdated 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    This is handled by the gitlab ticket

Production build 0.71.5 2024