Void is a reserved keyword in PHP7.1.

Running the unit tests with php nightly exposed the bug:

Fatal error: Cannot use phpDocumentor\Reflection\Types\Void as Void
because 'Void' is a special class name in
/home/travis/build/hboomsma/ReflectionDocBlock/tests/unit/DocBlock/Tags/MethodTest.php
on line 25
This commit is contained in:
Hidde Boomsma
2016-06-10 11:10:02 +02:00
parent 018dc90abb
commit 02fa9f585e
4 changed files with 25 additions and 25 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\Context as TypeContext;
use phpDocumentor\Reflection\Types\Void;
use phpDocumentor\Reflection\Types\Void_;
use Webmozart\Assert\Assert;
/**
@@ -50,7 +50,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
Assert::boolean($static);
if ($returnType === null) {
$returnType = new Void();
$returnType = new Void_();
}
$this->methodName = $methodName;
@@ -130,7 +130,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
$argument = explode(' ', trim($argument));
if ($argument[0][0] === '$') {
$argumentName = substr($argument[0], 1);
$argumentType = new Void();
$argumentType = new Void_();
} else {
$argumentType = $typeResolver->resolve($argument[0], $context);
$argumentName = '';
@@ -205,7 +205,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
$argument = [ 'name' => $argument ];
}
if (! isset($argument['type'])) {
$argument['type'] = new Void();
$argument['type'] = new Void_();
}
$keys = array_keys($argument);
if ($keys !== [ 'name', 'type' ]) {