Fix coding standard

Created on 29 November 2024, 4 months 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 field_group
  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

PHP CODE SNIFFER REPORT SUMMARY
----------------------------------------------------------------------
FILE                                                  ERRORS  WARNINGS
----------------------------------------------------------------------
...b/modules/contrib/field_group/coding_standard.txt  1       0
...eb/modules/contrib/field_group/field_group.module  5       0
.../src/Plugin/migrate/destination/d7/FieldGroup.php  2       0
...grate/src/Plugin/migrate/source/d7/FieldGroup.php  1       0
...dules/contrib/field_group/src/FormatterHelper.php  1       0
.../modules/field_group_test/field_group_test.module  1       0
----------------------------------------------------------------------
A TOTAL OF 11 ERRORS AND 0 WARNINGS WERE FOUND IN 6 FILES

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

4.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
  • Merge request !85coding standard β†’ (Open) created by ismaelromero
  • πŸ‡¨πŸ‡΄Colombia ismaelromero Somewhere in the exotic Colombia
  • Pipeline finished with Success
    4 months ago
    Total: 309s
    #354781
  • Hi @ismaelromero,

    I have checked the pipeline and re-ran the phpcs job. Confirmed no errors remaining and the job suceeded.

    Will now move this to RTBC

    Thanks,
    Jake

  • The function doc comments need to be updated to match the changes.

  • First commit to issue fork.
  • πŸ‡³πŸ‡±Netherlands ekes
  • Pipeline finished with Failed
    3 months ago
    Total: 343s
    #395632
  • PHPUnit failed in the pipeline. Is this the cause?

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    liam morland β†’ made their first commit to this issue’s fork.

  • Pipeline finished with Canceled
    3 months ago
    Total: 118s
    #395709
  • Pipeline finished with Failed
    3 months ago
    Total: 358s
    #395710
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    It passes on Drupal 11.0 but fails on 11.1 and 10.4. I think there was a change in those two that must be breaking it. I suspect it would also work on 10.3 if it was tested there. This looks like the issue addressed by πŸ› Drupal 10.4 RC1 error with field_ui.js Active .

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Thanks for working on this, just tagging with PHP 8.4, to easier follow along.

  • Pipeline finished with Success
    about 2 months ago
    Total: 345s
    #423336
  • Pipeline finished with Success
    about 2 months ago
    Total: 342s
    #423511
  • Status changed to RTBC about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Works great on the 4.x branch! No deprecation warnings, and Field Group still works.

    (People who contributed partial fixes to issues closed as duplicates who should get credit when this is fixed include prem suthar, deepali sardana, MrDaleSmith, and nickdickinsonwilde. And solideogloria who is already over here!)

  • πŸ‡«πŸ‡·France musa.thomas France πŸ‡«πŸ‡·

    The diff of issue fork can't be applied to the 3.6 version
    The issue Fork 8..x-3 seems to be different of the main issue fork ? what should I apply.
    Also got this depreciated but seems not to be resolved by the issue
    PHP 8.4 got this depreciated :
    Deprecated function : field_group_form_process(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead dans include_once() (/var/www/app/web/core/lib/Drupal/Core/Extension/Extension.php ligne 153)

    Deprecated function : field_group_field_group_form_process_build_alter(): Implicitly marking parameter $form_state as nullable is deprecated, the explicit nullable type must be used instead dans include_once() (/var/www/app/web/core/lib/Drupal/Core/Extension/Extension.php ligne 153)

    Message Deprecated function : field_group_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead dans include_once() (/var/www/app/web/core/lib/Drupal/Core/Extension/Extension.php ligne 153)

    Message Deprecated function : field_group_field_layout_fields_nest(): Implicitly marking parameter $vars as nullable is deprecated, the explicit nullable type must be used instead dans include_once() (/var/www/app/web/core/lib/Drupal/Core/Extension/Extension.php ligne 153)

    Message Deprecated function : field_group_group_save(): Implicitly marking parameter $display as nullable is deprecated, the explicit nullable type must be used instead dans include_once() (/var/www/app/web/core/lib/Drupal/Core/Extension/Extension.php ligne 153)

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    This issue is for fixing coding standards in the 4.x branch.

    The "Implicitly marking parameter as nullable is deprecated" message has already been fixed in 4.x. The fix for it in 8.x-3.x is discussed in πŸ› Fix PHP 8.4.x deprecation and other warnings (PHPStan) Active .

Production build 0.71.5 2024