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

native "null" return type is parsed as "object" #232

Closed
renanbr opened this issue Jun 11, 2015 · 1 comment
Closed

native "null" return type is parsed as "object" #232

renanbr opened this issue Jun 11, 2015 · 1 comment
Labels

Comments

@renanbr
Copy link

renanbr commented Jun 11, 2015

I'm not sure if this is the expected behavior, but it's not for me
When @return null is parsed, collector detects it as object


Reproducing...

./phpdox.xml config file

<?xml version="1.0" encoding="utf-8" ?>
<phpdox xmlns="http://xml.phpdox.net/config">
    <project name="Example" source="${basedir}/src" workdir="${basedir}/build">
        <collector backend="parser" />
    </project>
</phpdox>

./src/StrangeClass.php source file

<?php

class StrangeClass
{
    /**
     * @return null
     */
    public function doNothing(){}
}

After running phpdox --collector, here is ./build/classes/StrangeClass.xml

<?xml version="1.0" encoding="UTF-8"?>
<class xmlns="http://xml.phpdox.net/src" full="StrangeClass" namespace="" name="StrangeClass" abstract="false" final="false" start="3" end="9">
  <file path="/tmp/nulltype/src" file="StrangeClass.php" realpath="/tmp/nulltype/src/StrangeClass.php" size="101" time="2015-06-11T10:10:16+00:00" unixtime="1434017416" sha1="dd4d5a49de85f64e8814f0a680cb223dac9e29ce" relative="StrangeClass.php"/>
  <method name="doNothing" start="8" end="8" abstract="false" final="false" static="false" visibility="public">
    <docblock>
      <description/>
      <return type="object">
        <type full="null" namespace="" name="null"/>
      </return>
    </docblock>
  </method>
</class>
@theseer
Copy link
Owner

theseer commented Jun 11, 2015

No, that is not intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants