Permalink
Browse files

[Doctrine] Dont allow null in ORMQueryBuilderLoader

  • Loading branch information...
1 parent 988c2a5 commit 7646a5bc6da37d4f0ad455d9e550c7e2f284e5fe @beberlei beberlei committed with stof Dec 12, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php
@@ -30,19 +30,19 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
* @var Doctrine\ORM\QueryBuilder
*/
private $queryBuilder;
-
+
/**
* Construct an ORM Query Builder Loader
- *
+ *
* @param QueryBuilder $queryBuilder
* @param EntityManager $manager
- * @param string $class
+ * @param string $class
*/
public function __construct($queryBuilder, $manager = null, $class = null)
{
// If a query builder was passed, it must be a closure or QueryBuilder
// instance
- if (!(null === $queryBuilder || $queryBuilder instanceof QueryBuilder || $queryBuilder instanceof \Closure)) {
+ if (!($queryBuilder instanceof QueryBuilder || $queryBuilder instanceof \Closure)) {
throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder or \Closure');
}
@@ -53,15 +53,15 @@ public function __construct($queryBuilder, $manager = null, $class = null)
throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder');
}
}
-
+
$this->queryBuilder = $queryBuilder;
}
-
+
/**
* {@inheritDoc}
*/
public function getEntities()
{
return $this->queryBuilder->getQuery()->execute();
}
-}
+}

0 comments on commit 7646a5b

Please sign in to comment.