address phpstan complaints

Created on 3 June 2025, 6 days ago

Problem/Motivation

phpstan reports,

------ ----------------------------------------------------------------------------
Line src/Drush/Commands/ViewsBulkOperationsCommands.php
------ ----------------------------------------------------------------------------
12 Interface
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewDataInterface
referenced with incorrect case:
Drupal\views_bulk_operations\Service\ViewsbulkOperationsViewDataInterface.
------ ----------------------------------------------------------------------------

------ ----------------------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess)
------ ----------------------------------------------------------------------------------------
64 Access to an undefined property
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::$actionProcessor.
πŸ’‘ Learn more:
https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
81 Method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
82 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
82 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
114 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
120 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
129 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
213 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::currentUser().
229 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::currentUser().
241 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::currentUser().
253 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
271 Call to an undefined method
Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess::t().
------ ----------------------------------------------------------------------------------------

------ ------------------------------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Controller\ViewsBulkOperationsController)
------ ------------------------------------------------------------------------------------------------
81 Method
Drupal\views_bulk_operations\Controller\ViewsBulkOperationsController::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
------ ------------------------------------------------------------------------------------------------

------ ----------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Form\ConfigureAction)
------ ----------------------------------------------------------------------------
81 Method
Drupal\views_bulk_operations\Form\ConfigureAction::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
------ ----------------------------------------------------------------------------

------ ---------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Form\ConfirmAction)
------ ---------------------------------------------------------------------------
81 Method
Drupal\views_bulk_operations\Form\ConfirmAction::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
------ ---------------------------------------------------------------------------

------ ------------------------------------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm)
------ ------------------------------------------------------------------------------------------------------
81 Method
Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
------ ------------------------------------------------------------------------------------------------------

------ -------------------------------------------------------------------------------------------
Line src/Form/ViewsBulkOperationsFormTrait.php (in context of class
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData)
------ -------------------------------------------------------------------------------------------
64 Access to an undefined property
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::$actionProcessor.
πŸ’‘ Learn more:
https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
81 Method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::getSelectionInfoTitle()
should return Drupal\Core\StringTranslation\TranslatableMarkup but return
statement is missing.
82 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
82 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
114 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
120 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
129 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
199 Access to an undefined property
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::$tempStoreFactory.
πŸ’‘ Learn more:
https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
213 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::currentUser().
229 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::currentUser().
241 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::currentUser().
253 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
271 Call to an undefined method
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::t().
------ -------------------------------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Plugin/Action/CancelUserAction.php
------ ----------------------------------------------------------------------
105 \Drupal calls should be avoided in classes, use dependency injection
instead
------ ----------------------------------------------------------------------

------ -----------------------------------------------------------------------
Line src/Plugin/Action/EntityDeleteAction.php
------ -----------------------------------------------------------------------
31 Caught class
Drupal\views_bulk_operations\Plugin\Action\EntityStorageException not
found.
πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
------ -----------------------------------------------------------------------

------ ----------------------------------------------------------------------------
Line src/Plugin/views/field/ViewsBulkOperationsBulkForm.php
------ ----------------------------------------------------------------------------
24 Interface
Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewDataInterface
referenced with incorrect case:
Drupal\views_bulk_operations\Service\ViewsbulkOperationsViewDataInterface.
753 Undefined variable: $element
939 Undefined variable: $action_id
1096 Class Drupal\views_bulk_operations\Plugin\views\field\BulkForm not found.
πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------------

------ ----------------------------------------------------------------------------------------------
Line tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsAdvancedTestAction.php
------ ----------------------------------------------------------------------------------------------
49 \Drupal calls should be avoided in classes, use dependency injection
instead
------ ----------------------------------------------------------------------------------------------

Steps to reproduce

phpstan analyse -l0 views_bulk_operations

Proposed resolution

  • inject dependencies where possible
  • add the missing return statements
  • fix the incorrect case

Remaining tasks

make a MR

πŸ“Œ Task
Status

Active

Version

4.3

Component

Core

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

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