Fix PHP 8.4.x deprecation and other warnings (PHPStan)

Created on 5 February 2025, about 2 months ago

Problem/Motivation

Fix the following PHPStan issues:

------ ---------------------------------------------------------------------------------------------------------
  Line   contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php
 ------ ---------------------------------------------------------------------------------------------------------
  45     Deprecated in PHP 8.4: Parameter #5 $migration (Drupal\migrate\Plugin\MigrationInterface) is implicitly
         nullable via default value null.
  106    Deprecated in PHP 8.4: Parameter #1 $migration (Drupal\migrate\Plugin\MigrationInterface) is implicitly
         nullable via default value null.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   contrib/field_group_migrate/src/Plugin/migrate/source/d7/FieldGroup.php
 ------ ---------------------------------------------------------------------------------------------------------
  57     Deprecated in PHP 8.4: Parameter #5 $migration (Drupal\migrate\Plugin\MigrationInterface) is implicitly
         nullable via default value null.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------
  Line   field_group.module
 ------ --------------------------------------------------------------------------------------------------------------
  358    Call to static method isDisabled() on an unknown class Drupal\ds\Ds.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  426    Deprecated in PHP 8.4: Parameter #2 $form_state (Drupal\Core\Form\FormStateInterface) is implicitly nullable
         via default value null.
  493    Deprecated in PHP 8.4: Parameter #2 $form_state (Drupal\Core\Form\FormStateInterface) is implicitly nullable
         via default value null.
  637    Deprecated in PHP 8.4: Parameter #2 $vars (array) is implicitly nullable via default value null.
  730    Deprecated in PHP 8.4: Parameter #2 $vars (array) is implicitly nullable via default value null.
  824    No error to ignore is reported on line 824.
  877    Deprecated in PHP 8.4: Parameter #2 $display (Drupal\Core\Entity\Display\EntityDisplayInterface) is
         implicitly nullable via default value null.
 ------ --------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   modules/field_group_accordion/src/Plugin/field_group/FieldGroupFormatter/Accordion.php
 ------ ---------------------------------------------------------------------------------------------------------
  99     Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   modules/field_group_accordion/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php
 ------ ---------------------------------------------------------------------------------------------------------
  133    Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------
  Line   src/FormatterHelper.php
 ------ --------------------------------------------------------------------------------------------------------------
  63     Deprecated in PHP 8.4: Parameter #2 $form_state (Drupal\Core\Form\FormStateInterface) is implicitly nullable
         via default value null.
  121    No error to ignore is reported on line 121.
 ------ --------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   src/Plugin/field_group/FieldGroupFormatter/Details.php
 ------ ---------------------------------------------------------------------------------------------------------
  124    Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   src/Plugin/field_group/FieldGroupFormatter/Fieldset.php
 ------ ---------------------------------------------------------------------------------------------------------
  116    Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php
 ------ ---------------------------------------------------------------------------------------------------------
  253    Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------
  Line   src/Plugin/field_group/FieldGroupFormatter/Tab.php
 ------ ---------------------------------------------------------------------------------------------------------
  123    Static method Drupal\field_group\FieldGroupFormatterBase::defaultSettings() invoked with 1 parameter, 0
         required.
 ------ ---------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------
  Line   tests/modules/field_group_test/field_group_test.module
 ------ --------------------------------------------------------------------------------------------------------------
  20     Deprecated in PHP 8.4: Parameter #4 $items (Drupal\Core\Field\FieldItemListInterface) is implicitly nullable
         via default value null.
 ------ --------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   tests/src/FunctionalJavascript/HorizontalTabsLabelsTest.php
 ------ -------------------------------------------------------------------------------------------------------
  119    @dataProvider providerTestHorizontalTabsLabels related method must be static in PHPUnit 10 and newer.
 ------ -------------------------------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

4.0

Component

Miscellaneous

Created by

πŸ‡©πŸ‡ͺGermany Grevil

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024