Problem/Motivation

The module exposes myrest.helper and other services as concrete classes with no interfaces. Drupal.org best practice is to type-hint against interfaces so that consumers can decorate or swap implementations, and so that unit tests can mock them cleanly.

Proposed resolution

  • Add MyrestHelperInterface and interfaces for every service extracted in the service-split task.
  • Type-hint all consumers (normalizer, REST resources, event subscribers) against the interfaces.
  • Document the interfaces as the module's public API and mark concrete classes as @internal where appropriate.

Remaining tasks

Create interfaces, move docblocks to them, and update all type hints.

User interface changes

None.

API changes

New public interfaces define the supported API surface.

Issue fork myrest-3615140

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)