From 3a43ef2db3993833c659c62427aa72bccdef73b6 Mon Sep 17 00:00:00 2001 From: Hidde Boomsma Date: Wed, 8 Jun 2016 09:52:59 +0200 Subject: [PATCH] Rename Void to Void_ since it is a reserved keyword in PHP7.1 Fixing the followint failure: 1) phpDocumentor\Reflection\TypeResolverTest::testResolvingKeywords with data set #15 ('void', 'phpDocumentor\Reflection\Types\Void') PHPUnit_Framework_Exception: Argument #1 (No Value) of PHPUnit_Framework_Assert::assertInstanceOf() must be a class or interface name --- .travis.yml | 7 +++++-- src/TypeResolver.php | 2 +- src/Types/{Void.php => Void_.php} | 2 +- tests/unit/TypeResolverTest.php | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) rename src/Types/{Void.php => Void_.php} (96%) diff --git a/.travis.yml b/.travis.yml index 07316c7..c882b14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,14 @@ php: - 5.6 - 7.0 - hhvm + - nightly matrix: allow_failures: - - php: hhvm - + - php: + - hhvm + - nightly + cache: directories: - $HOME/.composer/cache diff --git a/src/TypeResolver.php b/src/TypeResolver.php index 23dd2c1..3a68a4d 100644 --- a/src/TypeResolver.php +++ b/src/TypeResolver.php @@ -38,7 +38,7 @@ final class TypeResolver 'mixed' => 'phpDocumentor\Reflection\Types\Mixed', 'array' => 'phpDocumentor\Reflection\Types\Array_', 'resource' => 'phpDocumentor\Reflection\Types\Resource', - 'void' => 'phpDocumentor\Reflection\Types\Void', + 'void' => 'phpDocumentor\Reflection\Types\Void_', 'null' => 'phpDocumentor\Reflection\Types\Null_', 'scalar' => 'phpDocumentor\Reflection\Types\Scalar', 'callback' => 'phpDocumentor\Reflection\Types\Callable_', diff --git a/src/Types/Void.php b/src/Types/Void_.php similarity index 96% rename from src/Types/Void.php rename to src/Types/Void_.php index 6a6156b..3d1be27 100644 --- a/src/Types/Void.php +++ b/src/Types/Void_.php @@ -20,7 +20,7 @@ * Void is generally only used when working with return types as it signifies that the method intentionally does not * return any value. */ -final class Void implements Type +final class Void_ implements Type { /** * Returns a rendered output of the Type as it would be used in a DocBlock. diff --git a/tests/unit/TypeResolverTest.php b/tests/unit/TypeResolverTest.php index bdea120..f226f8e 100644 --- a/tests/unit/TypeResolverTest.php +++ b/tests/unit/TypeResolverTest.php @@ -373,7 +373,7 @@ public function provideKeywords() ['scalar', 'phpDocumentor\Reflection\Types\Scalar'], ['object', 'phpDocumentor\Reflection\Types\Object_'], ['mixed', 'phpDocumentor\Reflection\Types\Mixed'], - ['void', 'phpDocumentor\Reflection\Types\Void'], + ['void', 'phpDocumentor\Reflection\Types\Void_'], ['$this', 'phpDocumentor\Reflection\Types\This'], ['static', 'phpDocumentor\Reflection\Types\Static_'], ['self', 'phpDocumentor\Reflection\Types\Self_'],