Wrong namespace for return values

Created on 17 January 2024, about 1 year ago
Updated 16 February 2024, about 1 year ago

Problem/Motivation

Some return values are defined using classes with a relative namespace e.g. Drupal\recurring_events\EventInterface. This causes problem when used in a file with already has a namespace.

Static analysis tools like PHPStan will error due to unknown classes e.g. Drupal\recurring_events\Entity\Drupal\recurring_events\EventInterface.

Steps to reproduce

- Call the id() method on the return value of $eventinstance->getEventSeries()
- See that PHPStan errors: Call to method id() on an unknown class Drupal\recurring_events\Entity\Drupal\recurring_events\EventInterface.

The problem can also be seen in editors like PHPStorm which will complain about unknown classes.

Proposed resolution

Update the return values specifications to use an absolute namespace.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Recurring Events (Main module)

Created by

πŸ‡©πŸ‡°Denmark kasperg

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