Coding standards issues 7.x-1.x

Created on 6 December 2024, 12 days ago

Problem/Motivation

Currently, the module contains inconsistencies in code formatting that do not adhere to the Drupal Coding Standards (Drupal Coding Standards and DrupalPractice). These inconsistencies make the code less readable and can create challenges during code review, in addition to impacting long-term maintainability.

The motivation for this issue is to align the module's code with the recommended standards, making it easier for the community to contribute and ensuring the code is clearer, more maintainable, and compatible with static analysis tools.

By implementing these changes, the module will better align with the Drupal community’s policies, and the effort required for future updates or reviews will be reduced.

Steps to reproduce

  1. Clone the repo
  2. cd views_contextual_filters_or
  3. run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css .

Proposed resolution

Fix reported errors and warnings

FILE                                                  ERRORS  WARNINGS
----------------------------------------------------------------------
...b/views_contextual_filters_or/coding_standard.txt  1       0
...es/contrib/views_contextual_filters_or/README.txt  0       1
...ual_filters_or/views_contextual_filters_or.module  1       0
..._filters_or/views_contextual_filters_or.views.inc  2       0
..._or/plugins/views_contextual_filters_or_query.inc  15      0
.../views_contextual_filters_or_search_api_query.inc  10      0
----------------------------------------------------------------------
A TOTAL OF 29 ERRORS AND 1 WARNING WERE FOUND IN 6 FILES

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡΄Colombia ismaelromero Somewhere in the exotic Colombia

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

Merge Requests

Comments & Activities

  • Issue created by @ismaelromero
  • πŸ‡¨πŸ‡΄Colombia ismaelromero Somewhere in the exotic Colombia
  • πŸ‡¨πŸ‡΄Colombia ismaelromero Somewhere in the exotic Colombia

    I've already submitted a commit with some changes, but there's some work to to:

    FILE: ...ters_or/plugins/views_contextual_filters_or_search_api_query.inc
    ----------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------
     11 | ERROR | Class name must begin with a capital letter
     11 | ERROR | Class name must use UpperCamel naming without
        |       | underscores
     16 | ERROR | Public method name
        |       | "views_contextual_filters_or_search_api_query::option_definition"
        |       | is not in lowerCamel format
     31 | ERROR | Public method name
        |       | "views_contextual_filters_or_search_api_query::options_form"
        |       | is not in lowerCamel format
    ----------------------------------------------------------------------
    
    
    FILE: ...textual_filters_or/plugins/views_contextual_filters_or_query.inc
    ----------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 5 LINES
    ----------------------------------------------------------------------
     11 | ERROR | Class name must begin with a capital letter
     11 | ERROR | Class name must use UpperCamel naming without
        |       | underscores
     16 | ERROR | Public method name
        |       | "views_contextual_filters_or_query::option_definition"
        |       | is not in lowerCamel format
     31 | ERROR | Public method name
        |       | "views_contextual_filters_or_query::options_form" is
        |       | not in lowerCamel format
     48 | ERROR | Public method name
        |       | "views_contextual_filters_or_query::add_where" is not
        |       | in lowerCamel format
     61 | ERROR | Public method name
        |       | "views_contextual_filters_or_query::add_where_expression"
        |       | is not in lowerCamel format
    ----------------------------------------------------------------------
  • Merge request !7Fix coding standars issues β†’ (Open) created by ismaelromero
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    @ismaelromero Be aware that bulk posting PHPCS fix issues can be seen as an attempt to game the credit system. https://www.drupal.org/drupalorg/docs/marketplace/abuse-of-the-contribut... β†’

    Also with D7 becoming EOL next month, I feel this might be a bit of waste of time πŸ™ƒ

Production build 0.71.5 2024