Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ `console` ] Replace usages of `EntityTypeRepository` with `EntityTypeRepositoryInterface` #3919

Closed
aronbeal opened this issue Jul 25, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@aronbeal
Copy link
Contributor

commented Jul 25, 2018

[ console ] Replace usages of EntityTypeRepository with EntityTypeRepositoryInterface

Problem/Motivation

A few classes rely on the injection of an EntityTypeRepository class, rather than EntityTypeRepositoryInterface, which precludes the replacement of these classes with
Symfony decoration.

Details to include:
Need to generalize the passed objects to be interfaces rather than base class
instances for the following classes:

  • \Drupal\Console\Command\Generate\PluginConditionCommand::__construct()
  • \Drupal\Console\Command\Entity\DeleteCommand::__construct()
  • \Drupal\Console\Command\Debug\EntityCommand::__construct()

How to reproduce

N/A

Details to include:

  • Drupal version: 8.5.5
  • Console version: 1.8.0
  • Drupal Console Launcher 1.8.0

Solution

drupal-console-constructor-fix.patch.txt

See attached patchfile:

  • Replaces relevant usages with interface equivalents.
@aronbeal

This comment has been minimized.

Copy link
Contributor Author

commented Sep 24, 2018

Note: we are specifically running into this issue because we are doing something similar to what is being done in https://www.drupal.org/project/entity_type_class. It is the Symfony Decorator Pattern being applied to \Drupal\Core\Entity\EntityTypeRepository, and because we are providing our subclasses rather than the original class, all these drupal console methods that expect the actual named class are breaking.

aronbeal added a commit to aronbeal/drupal-console that referenced this issue Sep 25, 2018

Changes constructor type signatures (hechoendrupal#3919)
Changes the type signatures for a few classes to use interfaces instead of classes.
@aronbeal

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2018

PR Introduced: #3934

LOBsTerr added a commit that referenced this issue Sep 26, 2018

Changes constructor type signatures (#3919) (#3934)
Changes the type signatures for a few classes to use interfaces instead of classes.
@LOBsTerr

This comment has been minimized.

Copy link
Member

commented Sep 26, 2018

@aronbeal I have merged it. Thanks for contribution

@LOBsTerr LOBsTerr closed this Sep 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.