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

Change type hinting to allow others EntityManagerInterfaces #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DataTransformer/EntityToIdTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gregwar\FormBundle\DataTransformer;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\FormException;
use Symfony\Component\Form\Exception\TransformationFailedException;
Expand Down Expand Up @@ -29,7 +30,7 @@ class EntityToIdTransformer implements DataTransformerInterface

private $unitOfWork;

public function __construct(EntityManager $em, $class, $property, $queryBuilder, $multiple)
public function __construct(EntityManagerInterface $em, $class, $property, $queryBuilder, $multiple)
{
if (!(null === $queryBuilder || $queryBuilder instanceof QueryBuilder || $queryBuilder instanceof \Closure)) {
throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder or \Closure');
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "Provides the \"entity_id\" type (read \"entity identifier\")",
"license": "MIT",
"require": {
"symfony/symfony": ">=2.1,<2.7-dev",
"symfony/framework-bundle": ">=2.1,<2.7-dev",
"symfony/symfony": ">=2.1,<=3.0.x-dev",
"symfony/framework-bundle": ">=2.1,<=3.0.x-dev",
"doctrine/doctrine-bundle": "*",
"doctrine/orm": "*"
},
Expand Down