<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 21:06:43 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/DCOM-38/DCOM-38.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>[DCOM-38] Annotation parser plain value types</title>
                <link>http://www.doctrine-project.org/jira/browse/DCOM-38</link>
                <project id="10043" key="DCOM">Doctrine Common</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I posted this question in doctrine user group(&lt;a href=&quot;https://groups.google.com/forum/?fromgroups#!topic/doctrine-user/QhAz-Yr70T0&quot; class=&quot;external-link&quot;&gt;https://groups.google.com/forum/?fromgroups#!topic/doctrine-user/QhAz-Yr70T0&lt;/a&gt;), but with no response, so I&apos;d like to open it up here as the solution is trivial and would save me either a lot of sub-classing or prevent me from changing the doctrine library files.&lt;/p&gt;

&lt;p&gt;This annotation&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;class SomeGrid {
    /**
     *  @GRID:Column(header=&lt;span class=&quot;code-quote&quot;&gt;&quot;Reg. plate&quot;&lt;/span&gt;, width=80, editable=TRUE, hidden=FALSE, tooltip=&lt;span class=&quot;code-quote&quot;&gt;&quot;Registration plate&quot;&lt;/span&gt;, align=&lt;span class=&quot;code-quote&quot;&gt;&quot;left&quot;&lt;/span&gt;, sortable=TRUE)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $regPlate;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;produces the following object:&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;(object) Grid\Annotations\Column {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;header&quot;&lt;/span&gt;   =&amp;gt; (string) &lt;span class=&quot;code-quote&quot;&gt;&quot;Reg. plate&quot;&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;width&quot;&lt;/span&gt;    =&amp;gt; (string) &lt;span class=&quot;code-quote&quot;&gt;&quot;80&quot;&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;editable&quot;&lt;/span&gt; =&amp;gt; (bool)   &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;hidden&quot;&lt;/span&gt;   =&amp;gt; (bool)   &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;tooltip&quot;&lt;/span&gt;  =&amp;gt; (string) &lt;span class=&quot;code-quote&quot;&gt;&quot;Registration plate&quot;&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;align&quot;&lt;/span&gt;    =&amp;gt; (string) &lt;span class=&quot;code-quote&quot;&gt;&quot;left&quot;&lt;/span&gt;
    &lt;span class=&quot;code-quote&quot;&gt;&quot;sortable&quot;&lt;/span&gt; =&amp;gt; (bool)   &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You can see the value of the width property is string even I didn&apos;t use quotes in the annotation.&lt;br/&gt;
The same happens with float values, but true and false values become, correctly, bool.&lt;/p&gt;

&lt;p&gt;I found this happens because of the following fragment of code in \Doctrine\Common\Annotations\Parser and could be easily corrected by prefixing the value with the corresponding type cast (marked in red).&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;    &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_STRING:
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match(Lexer::T_STRING);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;lexer-&amp;gt;token[&apos;value&apos;];
    &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_INTEGER:
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match(Lexer::T_INTEGER);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;)$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;lexer-&amp;gt;token[&apos;value&apos;];
    &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_FLOAT:
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match(Lexer::T_FLOAT);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; (&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;)$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;lexer-&amp;gt;token[&apos;value&apos;];
    &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_TRUE:
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match(Lexer::T_TRUE);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; Lexer::T_FALSE:
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;match(Lexer::T_FALSE);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The point is, in our app, some of the values go directly to browser and are processed by JavaScript. Having those values as strings breaks all kinds of mathematical operations on the client or would require additional (unnecessary) string to int/float conversions.&lt;/p&gt;</description>
                <environment>any</environment>
            <key id="12424">DCOM-38</key>
            <summary>Annotation parser plain value types</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="cicovec">Martin Ivi&#269;i&#269;</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Feb 2011 09:42:28 +0000</created>
                <updated>Thu, 7 Apr 2011 15:37:15 +0000</updated>
                    <resolved>Thu, 7 Apr 2011 15:37:15 +0000</resolved>
                            <version>2.0.1</version>
                                <fixVersion>2.0.2</fixVersion>
                                <component>Annotations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15711" author="beberlei" created="Thu, 7 Apr 2011 15:37:15 +0000"  >&lt;p&gt;Fixed.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>