Problem/Motivation
phpstan reports,
------ ---------------------------------------------
Line src/ConditionalFieldsElementAlterHelper.php
------ ---------------------------------------------
140 Variable $parent might not be defined.
------ ---------------------------------------------
------ ----------------------------------------------------------------------
Line src/ConditionalFieldsFormHelper.php
------ ----------------------------------------------------------------------
346 \Drupal calls should be avoided in classes, use dependency injection
instead
359 Variable $first_field might not be defined.
362 Variable $storage might not be defined.
363 Variable $field_name might not be defined.
370 Variable $field_name might not be defined.
597 Variable $field_name might not be defined.
810 Variable $error_key_arr on left side of ?? always exists and is not
nullable.
------ ----------------------------------------------------------------------
Steps to reproduce
https://git.drupalcode.org/project/conditional_fields/-/jobs/3780550
Proposed resolution
Define the variables before they are used.
Remaining tasks
make a MR
Issue fork conditional_fields-3544726
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
benstallings commentedComment #4
joelpittetThis is a duplicate of #3617084: Fix the PHPCS and PHPStan errors reported by GitLab CI, the problem is that the assumption was keeping D9 support made the constructor promotion go away. Thanks for trying to fix this @benstallings, ultimately went in a different direction.