theseer / phpdox

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)
http://phpdox.de
Other
599 stars 121 forks source link

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

Closed renanbr closed 9 years ago

renanbr commented 9 years ago

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 commented 9 years ago

No, that is not intended behavior.