Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:
Description
When i try to generate a new PersistentCollection like this:
###############################################
$collection = new ArrayCollection();
new \Doctrine\ORM\PersistentCollection(
$this->getEntityManager(),
new ClassMetadata(''),
$collection
);
###############################################
i get an typ hinting error like
"Expected array, got "Doctrine\Common\Collections\ArrayCollection"
This could be fixed by changing the type hinting for the Doctrine\ORM\PersistentCollection::__constructor
_From:_
###############################################
/**
- Creates a new persistent collection.
* - @param EntityManager $em The EntityManager the collection will be associated with.
- @param ClassMetadata $class The class descriptor of the entity type of this collection.
- @param array $coll The collection elements.
*/
public function __construct(EntityManager $em, $class, $coll)
{-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
_To:_
###############################################
/**
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creates a new persistent collection.
* - @param EntityManager $em The EntityManager the collection will be associated with.
- @param ClassMetadata $class The class descriptor of the entity type of this collection.
- @param \ArrayAccess $coll The collection elements.
*/
public function __construct(EntityManager $em, $class, $coll)
{
###############################################