Problem/Motivation
While scanning through the module, using PHPCS with the Drupal coding standards applied, I found a few CS issues:
------ ---------------------------------------------------------------------------------------------------
Line field_defaults.module
------ ---------------------------------------------------------------------------------------------------
24 Access to an undefined property Drupal\Core\Entity\EntityInterface::$changed.
36 Call to an undefined method Drupal\Core\Form\FormInterface::getEntity().
90 Call to an undefined method Drupal\Core\Form\FormInterface::getEntity().
109 Variable $provider might not be defined.
184 Access to an undefined property Drupal\Core\Entity\ContentEntityInterface::$batch_field_defaults.
------ ---------------------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Commands/FieldDefaultsBulkCommands.php
------ ------------------------------------------------------------------------------
66 \Drupal calls should be avoided in classes, use dependency injection instead
84 \Drupal calls should be avoided in classes, use dependency injection instead
85 \Drupal calls should be avoided in classes, use dependency injection instead
94 \Drupal calls should be avoided in classes, use dependency injection instead
120 \Drupal calls should be avoided in classes, use dependency injection instead
139 Cannot call method getName() on string.
167 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line src/Form/SettingsForm.php
------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
21 Property Drupal\field_defaults\Form\SettingsForm::$configFactory has unknown class Drupal\field_defaults\Form\Drupal\Core\Config\ConfigFactoryInterface as its type.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
28 Property Drupal\field_defaults\Form\SettingsForm::$messenger has unknown class Drupal\field_defaults\Form\Drupal\Core\Messenger\Messenger as its type.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
61 Call to method getEditable() on an unknown class Drupal\field_defaults\Form\Drupal\Core\Config\ConfigFactoryInterface.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
82 Call to method getEditable() on an unknown class Drupal\field_defaults\Form\Drupal\Core\Config\ConfigFactoryInterface.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note, that this output was automatically generated.
Steps to reproduce
Proposed resolution
Fix the before mentioned phpcs issues.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
b_sharpe commentedComment #4
b_sharpe commentedTests still passed, marking fixed.