Skip to content

Lint: Unused variable in RlAnalyzer.php #28

@jjroelofs

Description

@jjroelofs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions