Description
The Drupal coding standards linter (phpcs) and PHPStan found issues in the analytics API code.
Issues Found
1. Unused variable (phpcs)
File: src/Service/RlAnalyzer.php:674
WARNING | Unused variable $center.
2. Dead catch blocks (PHPStan)
File: src/Drush/Commands/RlCommands.php
Lines 95, 141, 183, 216, 256 | Dead catch - InvalidArgumentException is never thrown in the try block.
3. Unnecessary null coalesce (PHPStan)
File: src/Service/RlAnalyzer.php:309
Offset 'rate' on array always exists and is not nullable.
Fix
- Remove unused
$center variable
- Remove dead try-catch blocks (exceptions propagate naturally)
- Extract rate variables with proper empty array check
Description
The Drupal coding standards linter (phpcs) and PHPStan found issues in the analytics API code.
Issues Found
1. Unused variable (phpcs)
File:
src/Service/RlAnalyzer.php:6742. Dead catch blocks (PHPStan)
File:
src/Drush/Commands/RlCommands.php3. Unnecessary null coalesce (PHPStan)
File:
src/Service/RlAnalyzer.php:309Fix
$centervariable