Fix the issues reported by phpcs

Created on 30 March 2023, about 1 year ago

Problem/Motivation

FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/language_hierarchy.views.inc
------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
 12 | WARNING | [ ] Unused variable $entity_type_id.
 27 | ERROR   | [x] Short array syntax must be used to define arrays
------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/language_hierarchy.module
------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
------------------------------------------------------------------------
 199 | ERROR   | [ ] The array declaration extends to column 105 (the limit is 80). The array content should be split up over multiple lines
 201 | ERROR   | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
 340 | ERROR   | [ ] The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
 348 | WARNING | [ ] Unused variable $transaction.
 403 | ERROR   | [x] list(...) is forbidden, use [...] instead.
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/src/Config/LanguageHierarchyConfigOverride.php
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 29 | ERROR | Class property $target_storage should use lowerCamel naming without underscores
------------------------------------------------------------------------

FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/src/Plugin/views/sort/LanguageHierarchySort.php
-------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 56 | ERROR | [x] Expected 1 blank line after function; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/src/Plugin/views/filter/ContentLanguageFallbackLimitedFilter.php
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 40 | ERROR | Type hint "array" missing for $configuration
------------------------------------------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/src/StringDatabaseStorageDecorator.php
------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------
 94 | WARNING | Line exceeds 80 characters; contains 102 characters
-------------------------------------------------------------------------


FILE: ~/projects/drupal-d10/modules/contrib/language_hierarchy/src/EventSubscriber/LanguageHierarchyConfigEventSubscriber.php
------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------
 13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
------------------------------------------------------------------------

Time: 276ms; Memory: 14MB

Steps to reproduce

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

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

🇮🇳India Rashmisoni 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 @Rashmisoni
  • Assigned to dineshkumarbollu
  • 🇮🇳India dineshkumarbollu

    Hi

    I will work on this

  • @dineshkumarbollu opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Status changed to Closed: won't fix about 1 year ago
  • 🇬🇧United Kingdom james.williams

    Thanks for this, though there are definitely more important issues worth everyone's time. I've left a single comment on the only blocker, but to be honest, I would far rather you focussed on other more important issues. I see you've spent a lot of time raising issues about phpcs reports on modules, so I'm concerned that you might be wasting your own time and that of many module maintainers. Perhaps look at issues with the 'Novice' tag, or focus on those that already exist at higher priorities. Fixing reported phpcs issues doesn't really add very much value, and spending time on them takes away resource that could be spent on things that really would add value.

    Perhaps follow the guidance at https://www.drupal.org/community/contributor-guide/reference-information... → instead of raising these issues everywhere please.

Production build 0.69.0 2024