<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 02:46:27 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-2303/DDC-2303.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-2303] @param wrong in Doctrine\ORM\PersistentCollection::__constructor Edit</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2303</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;When  i try to generate a new PersistentCollection like this: &lt;br/&gt;
###############################################&lt;br/&gt;
     $collection = new ArrayCollection();&lt;br/&gt;
     new \Doctrine\ORM\PersistentCollection(&lt;br/&gt;
				$this-&amp;gt;getEntityManager(),&lt;br/&gt;
				new ClassMetadata(&apos;&apos;),&lt;br/&gt;
				 $collection&lt;br/&gt;
			);&lt;br/&gt;
###############################################&lt;br/&gt;
i get an typ hinting error like &lt;br/&gt;
&lt;b&gt;&quot;Expected array, got &quot;Doctrine\Common\Collections\ArrayCollection&quot;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;This could be fixed by changing the type hinting for the Doctrine\ORM\PersistentCollection::__constructor  &lt;br/&gt;
_&lt;em&gt;From:&lt;/em&gt;_&lt;br/&gt;
###############################################&lt;br/&gt;
     /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Creates a new persistent collection.&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param EntityManager $em    The EntityManager the collection will be associated with.&lt;/li&gt;
	&lt;li&gt;@param ClassMetadata $class The class descriptor of the entity type of this collection.&lt;/li&gt;
	&lt;li&gt;@param array       $coll  The collection elements.&lt;br/&gt;
     */&lt;br/&gt;
    public function __construct(EntityManager $em, $class, $coll)&lt;br/&gt;
    {
	&lt;ol&gt;
		&lt;li&gt;
		&lt;ol&gt;
			&lt;li&gt;
			&lt;ol&gt;
				&lt;li&gt;
				&lt;ol&gt;
					&lt;li&gt;
					&lt;ol&gt;
						&lt;li&gt;
						&lt;ol&gt;
							&lt;li&gt;
							&lt;ol&gt;
								&lt;li&gt;
								&lt;ol&gt;
									&lt;li&gt;
									&lt;ol&gt;
										&lt;li&gt;
										&lt;ol&gt;
											&lt;li&gt;
											&lt;ol&gt;
												&lt;li&gt;
												&lt;ol&gt;
													&lt;li&gt;
													&lt;ol&gt;
														&lt;li&gt;
														&lt;ol&gt;
															&lt;li&gt;
															&lt;ol&gt;
																&lt;li&gt;
																&lt;ol&gt;
																	&lt;li&gt;
																	&lt;ol&gt;
																		&lt;li&gt;
																		&lt;ol&gt;
																			&lt;li&gt;
																			&lt;ol&gt;
																				&lt;li&gt;
																				&lt;ol&gt;
																					&lt;li&gt;
																					&lt;ol&gt;
																						&lt;li&gt;
																						&lt;ol&gt;
																							&lt;li&gt;
																							&lt;ol&gt;
																								&lt;li&gt;
																								&lt;ol&gt;
																									&lt;li&gt;
																									&lt;ol&gt;
																										&lt;li&gt;
																										&lt;ol&gt;
																											&lt;li&gt;
																											&lt;ol&gt;
																												&lt;li&gt;
																												&lt;ol&gt;
																													&lt;li&gt;
																													&lt;ol&gt;
																														&lt;li&gt;
																														&lt;ol&gt;
																															&lt;li&gt;
																															&lt;ol&gt;
																																&lt;li&gt;
																																&lt;ol&gt;
																																	&lt;li&gt;
																																	&lt;ol&gt;
																																		&lt;li&gt;
																																		&lt;ol&gt;
																																			&lt;li&gt;
																																			&lt;ol&gt;
																																				&lt;li&gt;
																																				&lt;ol&gt;
																																					&lt;li&gt;
																																					&lt;ol&gt;
																																						&lt;li&gt;
																																						&lt;ol&gt;
																																							&lt;li&gt;
																																							&lt;ol&gt;
																																								&lt;li&gt;
																																								&lt;ol&gt;
																																									&lt;li&gt;
																																									&lt;ol&gt;
																																										&lt;li&gt;
																																										&lt;ol&gt;
																																											&lt;li&gt;
																																											&lt;ol&gt;
																																												&lt;li&gt;
																																												&lt;ol&gt;
																																													&lt;li&gt;
																																													&lt;ol&gt;
																																														&lt;li&gt;
																																														&lt;ol&gt;
																																															&lt;li&gt;&lt;p&gt;_&lt;em&gt;To:&lt;/em&gt;_&lt;br/&gt;
###############################################&lt;br/&gt;
     /**&lt;/p&gt;&lt;/li&gt;
																																														&lt;/ol&gt;
																																														&lt;/li&gt;
																																													&lt;/ol&gt;
																																													&lt;/li&gt;
																																												&lt;/ol&gt;
																																												&lt;/li&gt;
																																											&lt;/ol&gt;
																																											&lt;/li&gt;
																																										&lt;/ol&gt;
																																										&lt;/li&gt;
																																									&lt;/ol&gt;
																																									&lt;/li&gt;
																																								&lt;/ol&gt;
																																								&lt;/li&gt;
																																							&lt;/ol&gt;
																																							&lt;/li&gt;
																																						&lt;/ol&gt;
																																						&lt;/li&gt;
																																					&lt;/ol&gt;
																																					&lt;/li&gt;
																																				&lt;/ol&gt;
																																				&lt;/li&gt;
																																			&lt;/ol&gt;
																																			&lt;/li&gt;
																																		&lt;/ol&gt;
																																		&lt;/li&gt;
																																	&lt;/ol&gt;
																																	&lt;/li&gt;
																																&lt;/ol&gt;
																																&lt;/li&gt;
																															&lt;/ol&gt;
																															&lt;/li&gt;
																														&lt;/ol&gt;
																														&lt;/li&gt;
																													&lt;/ol&gt;
																													&lt;/li&gt;
																												&lt;/ol&gt;
																												&lt;/li&gt;
																											&lt;/ol&gt;
																											&lt;/li&gt;
																										&lt;/ol&gt;
																										&lt;/li&gt;
																									&lt;/ol&gt;
																									&lt;/li&gt;
																								&lt;/ol&gt;
																								&lt;/li&gt;
																							&lt;/ol&gt;
																							&lt;/li&gt;
																						&lt;/ol&gt;
																						&lt;/li&gt;
																					&lt;/ol&gt;
																					&lt;/li&gt;
																				&lt;/ol&gt;
																				&lt;/li&gt;
																			&lt;/ol&gt;
																			&lt;/li&gt;
																		&lt;/ol&gt;
																		&lt;/li&gt;
																	&lt;/ol&gt;
																	&lt;/li&gt;
																&lt;/ol&gt;
																&lt;/li&gt;
															&lt;/ol&gt;
															&lt;/li&gt;
														&lt;/ol&gt;
														&lt;/li&gt;
													&lt;/ol&gt;
													&lt;/li&gt;
												&lt;/ol&gt;
												&lt;/li&gt;
											&lt;/ol&gt;
											&lt;/li&gt;
										&lt;/ol&gt;
										&lt;/li&gt;
									&lt;/ol&gt;
									&lt;/li&gt;
								&lt;/ol&gt;
								&lt;/li&gt;
							&lt;/ol&gt;
							&lt;/li&gt;
						&lt;/ol&gt;
						&lt;/li&gt;
					&lt;/ol&gt;
					&lt;/li&gt;
				&lt;/ol&gt;
				&lt;/li&gt;
			&lt;/ol&gt;
			&lt;/li&gt;
		&lt;/ol&gt;
		&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
	&lt;li&gt;Creates a new persistent collection.&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param EntityManager $em    The EntityManager the collection will be associated with.&lt;/li&gt;
	&lt;li&gt;@param ClassMetadata $class The class descriptor of the entity type of this collection.&lt;/li&gt;
	&lt;li&gt;@param \ArrayAccess $coll  The collection elements.&lt;br/&gt;
     */&lt;br/&gt;
    public function __construct(EntityManager $em, $class, $coll)&lt;br/&gt;
    {&lt;br/&gt;
###############################################&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14494">DDC-2303</key>
            <summary>@param wrong in Doctrine\ORM\PersistentCollection::__constructor Edit</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="ocramius">Marco Pivetta</assignee>
                                <reporter username="datkind">Torsten Granek</reporter>
                        <labels>
                        <label>collection</label>
                    </labels>
                <created>Mon, 18 Feb 2013 15:27:10 +0000</created>
                <updated>Tue, 26 Feb 2013 08:47:07 +0000</updated>
                    <resolved>Tue, 26 Feb 2013 08:47:07 +0000</resolved>
                                                            <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19559" author="datkind" created="Mon, 18 Feb 2013 15:30:28 +0000"  >&lt;p&gt; When  i try to generate a new PersistentCollection like this: &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

     $collection = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection();
     &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ORM\PersistentCollection(
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getEntityManager(),
				&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ClassMetadata(&apos;&apos;),
				 $collection
			);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I get an typ hinting error like &lt;br/&gt;
&lt;b&gt;&quot;Expected array, got &quot;Doctrine\Common\Collections\ArrayCollection&quot;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;This could be fixed by changing the type hinting for the Doctrine\ORM\PersistentCollection::__constructor  &lt;br/&gt;
_&lt;em&gt;From:&lt;/em&gt;_&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
     /**
     * Creates a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; persistent collection.
     *
     * @param EntityManager $em    The EntityManager the collection will be associated with.
     * @param ClassMetadata $class The class descriptor of the entity type of &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; collection.
     * @param array       $coll  The collection elements.
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct(EntityManager $em, $class, $coll)
    {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;_&lt;em&gt;To:&lt;/em&gt;_&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
     /**
     * Creates a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; persistent collection.
     *
     * @param EntityManager $em    The EntityManager the collection will be associated with.
     * @param ClassMetadata $class The class descriptor of the entity type of &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; collection.
     * @param \ArrayAccess $coll  The collection elements.
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct(EntityManager $em, $class, $coll)
    {

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="19564" author="stof" created="Mon, 18 Feb 2013 22:34:49 +0000"  >&lt;p&gt;There is no typehint in the PersistentCollection constructor. So the issue cannot come from this place (the phpdoc is wrong btw, it expects a Collection, not an array)&lt;/p&gt;

&lt;p&gt;Please give the full error, i.e. the message &lt;b&gt;and the location&lt;/b&gt; so that we can know where it happens.&lt;/p&gt;</comment>
                    <comment id="19570" author="datkind" created="Wed, 20 Feb 2013 07:53:14 +0000"  >&lt;p&gt;There error is not in the function declaration, it is in the @param in the doc block of the constructor.&lt;/p&gt;

&lt;p&gt;Using PHPStorm as IDE i got this error thrown by the IDE it self, not php. (Screenshot will be attached)&lt;/p&gt;

&lt;p&gt;Using ZF2 the error is on line 121 at:&lt;br/&gt;
vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php &lt;/p&gt;</comment>
                    <comment id="19571" author="datkind" created="Wed, 20 Feb 2013 07:54:35 +0000"  >&lt;p&gt;Using PHPStorm as IDE i got &quot;Expected array, got &quot;Doctrine\Common\Collections\ArrayCollection&quot; thrown by the IDE it self, not php.&lt;/p&gt;</comment>
                    <comment id="19572" author="datkind" created="Wed, 20 Feb 2013 07:56:41 +0000"  >&lt;p&gt;Using PHPStorm as IDE i got &quot;Expected array, got &quot;Doctrine\Common\Collections\ArrayCollection&quot; thrown by the IDE it self, not php.&lt;/p&gt;</comment>
                    <comment id="19689" author="ocramius" created="Tue, 26 Feb 2013 08:47:07 +0000"  >&lt;p&gt;The correct type hint here is `Doctrine\Common\Collections\Collection`.&lt;/p&gt;

&lt;p&gt;I&apos;m closing this as invalid, since you shouldn&apos;t instantiate a persistent collection on your own. Consider opening a pull request at &lt;a href=&quot;https://github.com/doctrine/doctrine2&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2&lt;/a&gt; instead if you want to fix the typehint.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11381" name="screenshot-1.jpg" size="22940" author="datkind" created="Wed, 20 Feb 2013 07:56:41 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>