Skip to content

Commit

Permalink
Consider container as always set
Browse files Browse the repository at this point in the history
This implies removing an unnecessary check, and documenting the property
holding the container as non-nullable.
  • Loading branch information
rosier authored and greg0ire committed Jan 20, 2020
1 parent bb1ac0d commit 2834c4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Repository/ContainerRepositoryFactory.php
Expand Up @@ -18,7 +18,7 @@ final class ContainerRepositoryFactory implements RepositoryFactory
/** @var ObjectRepository[] */
private $managedRepositories = [];

/** @var ContainerInterface|null */
/** @var ContainerInterface */
private $container;

/**
Expand All @@ -40,7 +40,7 @@ public function getRepository(EntityManagerInterface $entityManager, $entityName
$customRepositoryName = $metadata->customRepositoryClassName;
if ($customRepositoryName !== null) {
// fetch from the container
if ($this->container && $this->container->has($customRepositoryName)) {
if ($this->container->has($customRepositoryName)) {
$repository = $this->container->get($customRepositoryName);

if (! $repository instanceof ObjectRepository) {
Expand Down

0 comments on commit 2834c4b

Please sign in to comment.