Skip to content

Commit 0932dd9

Browse files
committed
Fix issue #232
1 parent d674837 commit 0932dd9

9 files changed

+24
-7
lines changed

src/docblock/elements/VarElement.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class VarElement extends GenericElement {
4545
* @var string[]
4646
*/
4747
private $types = array(
48-
'', 'mixed', '{unknown}', 'object', 'array', 'integer', 'int', 'float', 'string', 'boolean', 'resource'
48+
'', 'null', 'mixed', '{unknown}', 'object', 'array', 'integer', 'int',
49+
'float', 'string', 'boolean', 'resource'
4950
);
5051

5152
public function asDom(\TheSeer\fDOM\fDOMDocument $ctx) {

src/docblock/parser/GenericParser.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class GenericParser {
4545
protected $payload;
4646

4747
private $types = array(
48-
'', 'mixed', '{unknown}', 'object', 'array', 'integer', 'int', 'float', 'string', 'boolean', 'resource', 'static'
48+
'', 'null', 'mixed', '{unknown}', 'object', 'array', 'integer', 'int',
49+
'float', 'string', 'boolean', 'resource'
4950
);
5051

5152
public function __construct(Factory $factory, $name) {

tests/data/docbock/docblock.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="object"><type full="null" namespace="" name="null"/></return></docblock>
1+
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="null"/></docblock>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading.">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="object"><type full="null" namespace="" name="null"/></return></docblock>
1+
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading.">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="null" /></docblock>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading that spans multiple lines.">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="object"><type full="null" namespace="" name="null"/></return></docblock>
1+
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading that spans multiple lines.">the body</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="null" /></docblock>

tests/data/docbock/heading.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading"/><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="object"><type full="null" namespace="" name="null"/></return></docblock>
1+
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading"/><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="null" /></docblock>

tests/data/docbock/multiline_body.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<docblock xmlns="http://xml.phpdox.net/src"><description compact="the heading">this body
22
spans multiple
3-
lines</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="object"><type full="null" namespace="" name="null"/></return></docblock>
3+
lines</description><param description="The foo parameter" type="string" variable="$foo"/><param description="Number of bars" type="int" variable="$bar"/><return type="null" /></docblock>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
class StrangeClass
4+
{
5+
/**
6+
* @return null
7+
*/
8+
public function doNothing(){}
9+
}

tests/data/issue232/test.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<phpdox xmlns="http://xml.phpdox.net/config">
3+
<project name="Example" source="${basedir}/src" workdir="${basedir}/xml">
4+
<collector backend="parser" />
5+
</project>
6+
</phpdox>

0 commit comments

Comments
 (0)