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

@aronbeal
Copy link
Contributor

aronbeal 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
Copy link
Contributor Author

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 the type signatures for a few classes to use interfaces instead of classes.
@aronbeal
Copy link
Contributor Author

PR Introduced: #3934

LOBsTerr pushed a commit that referenced this issue Sep 26, 2018
Changes the type signatures for a few classes to use interfaces instead of classes.
@LOBsTerr
Copy link
Member

@aronbeal I have merged it. Thanks for contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants