diff --git a/modules/typed_entity_ui/src/Controller/ExploreDetails.php b/modules/typed_entity_ui/src/Controller/ExploreDetails.php index 172a1f8124bff4501c6be778109f0920576c21d8..8c329b23140fcdb5da3a0f1ca74b6243c252b6dd 100644 --- a/modules/typed_entity_ui/src/Controller/ExploreDetails.php +++ b/modules/typed_entity_ui/src/Controller/ExploreDetails.php @@ -47,10 +47,11 @@ class ExploreDetails extends ControllerBase { * @param \Drupal\typed_entity\RepositoryManager $repository_manager * The repository manager. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $bundle_info, RepositoryManager $repository_manager) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $bundle_info, RepositoryManager $repository_manager, \Drupal\typed_entity\RepositoryManager $repositoryManager) { $this->entityTypeManager = $entity_type_manager; $this->bundleInfo = $bundle_info; $this->repositoryManager = $repository_manager; + $this->repositoryManager = $repositoryManager; } /** @@ -60,7 +61,7 @@ class ExploreDetails extends ControllerBase { return new static( $container->get('entity_type.manager'), $container->get('entity_type.bundle.info'), - $container->get(RepositoryManager::class) + $this->repositoryManager ); } diff --git a/modules/typed_entity_ui/src/Form/ExploreForm.php b/modules/typed_entity_ui/src/Form/ExploreForm.php index ed4d2c96f1a809037b95d57eb4f2cdea23db55ca..2ace0b368bf477ed30acd63890ac97894f51e953 100644 --- a/modules/typed_entity_ui/src/Form/ExploreForm.php +++ b/modules/typed_entity_ui/src/Form/ExploreForm.php @@ -64,11 +64,12 @@ class ExploreForm extends FormBase { * @param \Drupal\Core\State\StateInterface $state * The state interface. */ - public function __construct(EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $bundleInfo, RepositoryManager $repository_manager, StateInterface $state) { + public function __construct(EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $bundleInfo, RepositoryManager $repository_manager, StateInterface $state, \Drupal\typed_entity\RepositoryManager $repositoryManager) { $this->entityTypeManager = $entityTypeManager; $this->bundleInfo = $bundleInfo; $this->repositoryManager = $repository_manager; $this->state = $state; + $this->repositoryManager = $repositoryManager; } /** @@ -78,7 +79,7 @@ class ExploreForm extends FormBase { return new static( $container->get('entity_type.manager'), $container->get('entity_type.bundle.info'), - $container->get(RepositoryManager::class), + $this->repositoryManager, $container->get('state') ); } diff --git a/tests/src/Kernel/TypedEntityRendererTest.php b/tests/src/Kernel/TypedEntityRendererTest.php index bc083fc6dfd250aafa172b74ce45d800ed067f7a..fbf13808a3c407a46d1f9adb722072779cbb8bc1 100644 --- a/tests/src/Kernel/TypedEntityRendererTest.php +++ b/tests/src/Kernel/TypedEntityRendererTest.php @@ -103,7 +103,7 @@ class TypedEntityRendererTest extends KernelTestBase { * @return array * The data. */ - public function rendererNegotiationViewModeDataProvider(): array { + public static function rendererNegotiationViewModeDataProvider(): array { return [ ['foo', TypedEntityRendererBase::class], [Teaser::VIEW_MODE, Teaser::class], @@ -129,7 +129,7 @@ class TypedEntityRendererTest extends KernelTestBase { * @return array * The data. */ - public function rendererNegotiationStateDataProvider(): array { + public static function rendererNegotiationStateDataProvider(): array { return [ [FALSE, TypedEntityRendererBase::class], [TRUE, ConditionalRenderer::class], diff --git a/tests/src/Unit/RepositoryManagerTest.php b/tests/src/Unit/RepositoryManagerTest.php index 0d0c0703da1814f863b4e101325776b58f902a88..d4240c9c3c80add6b1c05a72319f0f2e5bc8c571 100644 --- a/tests/src/Unit/RepositoryManagerTest.php +++ b/tests/src/Unit/RepositoryManagerTest.php @@ -81,7 +81,7 @@ class RepositoryManagerTest extends UnitTestCase { /** * Data provider for testGet. */ - public function getDataProvider(): array { + public static function getDataProvider(): array { return [ ['foo', 'bar', 1], ['oof', 'faa', 3],