Skip to content

Commit

Permalink
Rename Void to Void_ since it is a reserved keyword in PHP7.1
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hidde Boomsma committed Jun 8, 2016
1 parent 9891754 commit 3a43ef2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ php:
- 5.6
- 7.0
- hhvm
- nightly

matrix:
allow_failures:
- php: hhvm

- php:
- hhvm
- nightly

cache:
directories:
- $HOME/.composer/cache
Expand Down
2 changes: 1 addition & 1 deletion src/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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_',
Expand Down
2 changes: 1 addition & 1 deletion src/Types/Void.php → src/Types/Void_.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/TypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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_'],
Expand Down

0 comments on commit 3a43ef2

Please sign in to comment.