Skip to content

Commit

Permalink
type hint for EntityManagerInterface instead of EntityManager
Browse files Browse the repository at this point in the history
  • Loading branch information
tetranz committed May 28, 2016
1 parent ea1e5a8 commit 1ef8afa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Form/DataTransformer/EntitiesToPropertyTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\PropertyAccess\PropertyAccess;
Expand All @@ -17,7 +17,7 @@
*/
class EntitiesToPropertyTransformer implements DataTransformerInterface
{
/** @var EntityManager */
/** @var EntityManagerInterface */
protected $em;
/** @var string */
protected $className;
Expand All @@ -27,12 +27,12 @@ class EntitiesToPropertyTransformer implements DataTransformerInterface
protected $primaryKey;

/**
* @param EntityManager $em
* @param EntityManagerInterface $em
* @param string $class
* @param string|null $textProperty
* @param string $primaryKey
*/
public function __construct(EntityManager $em, $class, $textProperty = null, $primaryKey = 'id')
public function __construct(EntityManagerInterface $em, $class, $textProperty = null, $primaryKey = 'id')
{
$this->em = $em;
$this->className = $class;
Expand Down
8 changes: 4 additions & 4 deletions Form/DataTransformer/EntityToPropertyTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Tetranz\Select2EntityBundle\Form\DataTransformer;

use Doctrine\DBAL\Exception\DriverException;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\PropertyAccess\PropertyAccess;
Expand All @@ -16,7 +16,7 @@
*/
class EntityToPropertyTransformer implements DataTransformerInterface
{
/** @var EntityManager */
/** @var EntityManagerInterface */
protected $em;
/** @var string */
protected $className;
Expand All @@ -26,12 +26,12 @@ class EntityToPropertyTransformer implements DataTransformerInterface
protected $primaryKey;

/**
* @param EntityManager $em
* @param EntityManagerInterface $em
* @param string $class
* @param string|null $textProperty
* @param string $primaryKey
*/
public function __construct(EntityManager $em, $class, $textProperty = null, $primaryKey = 'id')
public function __construct(EntityManagerInterface $em, $class, $textProperty = null, $primaryKey = 'id')
{
$this->em = $em;
$this->className = $class;
Expand Down
10 changes: 5 additions & 5 deletions Form/Type/Select2EntityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tetranz\Select2EntityBundle\Form\Type;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\FormBuilderInterface;
Expand All @@ -21,7 +21,7 @@
*/
class Select2EntityType extends AbstractType
{
/** @var EntityManager */
/** @var EntityManagerInterface */
protected $em;
/** @var Router */
protected $router;
Expand All @@ -39,16 +39,16 @@ class Select2EntityType extends AbstractType
protected $cache;

/**
* @param EntityManager $em
* @param Router $router
* @param EntityManagerInterface $em
* @param RouterInterface $router
* @param integer $minimumInputLength
* @param integer $pageLimit
* @param boolean $allowClear
* @param integer $delay
* @param string $language
* @param boolean $cache
*/
public function __construct(EntityManager $em, RouterInterface $router, $minimumInputLength, $pageLimit, $allowClear, $delay, $language, $cache)
public function __construct(EntityManagerInterface $em, RouterInterface $router, $minimumInputLength, $pageLimit, $allowClear, $delay, $language, $cache)
{
$this->em = $em;
$this->router = $router;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"php": ">=5.4.0",
"symfony/symfony": ">=2.2",
"doctrine/orm": ">=2.2"
"doctrine/orm": ">=2.4"
},
"autoload": {
"psr-0": { "Tetranz\\Select2EntityBundle": "" }
Expand Down

0 comments on commit 1ef8afa

Please sign in to comment.