- Issue created by @jonathan1055
- Merge request !229#3507012 Dependency injection instead of \Drupal calls → (Open) created by jonathan1055
PHPStan reports (and currently is forced to ignore) many \Drupal calls should be avoided in classes, use dependency injection instead
warning. If possible these should be fixed and then removed from phpstan-baseline-to-fix.neon
Or if not possible to fix, then the ignoreError should be moved into the phpstan-baseline.neon
file of permanently ignored warnings.
As at issue creation (16 Feb 2025) the phpstan custom summary script reports the following
---------------------------------------------------------------------------
Summary of PHPStan messages in phpstan-baseline-to-fix.neon
---------------------------------------------------------------------------
Drupal calls should be avoided in classes, use dependency injection instead
36 occurrence(s) in 12 file(s)
scheduler_rules_integration/src/Plugin/Condition/PublishingIsEnabled.php
scheduler_rules_integration/src/Plugin/Condition/UnpublishingIsEnabled.php
scheduler_rules_integration/src/Plugin/RulesAction/RemovePublishingDate.php
scheduler_rules_integration/src/Plugin/RulesAction/RemoveUnpublishingDate.php
scheduler_rules_integration/src/Plugin/RulesAction/SchedulerRulesActionBase.php
scheduler_rules_integration/src/Plugin/RulesAction/SetPublishingDate.php
scheduler_rules_integration/src/Plugin/RulesAction/SetUnpublishingDate.php
src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
src/Routing/SchedulerRouteSubscriber.php
src/SchedulerManager.php
src/Theme/SchedulerThemeNegotiator.php
---------------------------------------------------------------------------
Number of messages by file
17 in src/SchedulerManager.php
4 in src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
3 in src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
3 in src/Theme/SchedulerThemeNegotiator.php
2 in scheduler_rules_integration/src/Plugin/RulesAction/SchedulerRulesActionBase.php
1 in scheduler_rules_integration/src/Plugin/Condition/PublishingIsEnabled.php
1 in scheduler_rules_integration/src/Plugin/Condition/UnpublishingIsEnabled.php
1 in scheduler_rules_integration/src/Plugin/RulesAction/RemovePublishingDate.php
1 in scheduler_rules_integration/src/Plugin/RulesAction/RemoveUnpublishingDate.php
1 in scheduler_rules_integration/src/Plugin/RulesAction/SetPublishingDate.php
1 in scheduler_rules_integration/src/Plugin/RulesAction/SetUnpublishingDate.php
1 in src/Routing/SchedulerRouteSubscriber.php
---------------------------------------------------------------------------
Different types of message: 1
Total number of messages: 36
---------------------------------------------------------------------------
Active
2.0
Coding Standards