Problem/Motivation
When testing LTI Tool Provider 3.0.0 on Drupal 11, the Provision submodule produces the following PHP warning:
Warning: The use statement with non-compound name 'Exception' has no effect
The warning occurs in:
modules/lti_tool_provider_provision/lti_tool_provider_provision.module
on line 10.
The module contains the following statement:
use Exception;
Since this is a procedural `.module` file in the global namespace, importing the non-compound class name `Exception` has no effect and results in the warning.
Steps to reproduce
1. Install LTI Tool Provider 3.0.0 on Drupal 11.
2. Enable the LTI Tool Provider Provision submodule.
3. Load functionality that includes lti_tool_provider_provision.module.
4. Observe the PHP warning:
Warning: The use statement with non-compound name 'Exception' has no effect
Proposed resolution
Remove the unnecessary use Exception; statement from lti_tool_provider_provision.module.
Exception handling can continue to use Exception in the existing code, or explicitly reference \Exception where appropriate.
Remaining tasks
- Remove the ineffective
use Exception;statement. - Verify that the PHP warning no longer occurs.
- Run the relevant module tests.
- Verify the Provision submodule functionality on Drupal 11.
User interface changes
No user interface changes.
API changes
No API changes.
Data model changes
No data model changes.
Comments