Skip to content

Commit 9270140

Browse files
authored
Merge pull request #75 from hboomsma/feature/php71_compat
Feature/php71 compat
2 parents ea48fd2 + 02fa9f5 commit 9270140

File tree

5 files changed

+29
-26
lines changed

5 files changed

+29
-26
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ php:
44
- 5.6
55
- 7.0
66
- hhvm
7+
- nightly
78

89
matrix:
910
allow_failures:
10-
- php: hhvm
11+
- php:
12+
- hhvm
13+
- nightly
1114

1215
cache:
1316
directories:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"php": ">=5.5",
1414
"phpdocumentor/reflection-common": "^1.0@dev",
15-
"phpdocumentor/type-resolver": "^0.1.5",
15+
"phpdocumentor/type-resolver": "^0.2.0",
1616
"webmozart/assert": "^1.0"
1717
},
1818
"autoload": {

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DocBlock/Tags/Method.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use phpDocumentor\Reflection\Type;
1818
use phpDocumentor\Reflection\TypeResolver;
1919
use phpDocumentor\Reflection\Types\Context as TypeContext;
20-
use phpDocumentor\Reflection\Types\Void;
20+
use phpDocumentor\Reflection\Types\Void_;
2121
use Webmozart\Assert\Assert;
2222

2323
/**
@@ -50,7 +50,7 @@ public function __construct(
5050
Assert::boolean($static);
5151

5252
if ($returnType === null) {
53-
$returnType = new Void();
53+
$returnType = new Void_();
5454
}
5555

5656
$this->methodName = $methodName;
@@ -130,7 +130,7 @@ public static function create(
130130
$argument = explode(' ', trim($argument));
131131
if ($argument[0][0] === '$') {
132132
$argumentName = substr($argument[0], 1);
133-
$argumentType = new Void();
133+
$argumentType = new Void_();
134134
} else {
135135
$argumentType = $typeResolver->resolve($argument[0], $context);
136136
$argumentName = '';
@@ -205,7 +205,7 @@ private function filterArguments($arguments)
205205
$argument = [ 'name' => $argument ];
206206
}
207207
if (! isset($argument['type'])) {
208-
$argument['type'] = new Void();
208+
$argument['type'] = new Void_();
209209
}
210210
$keys = array_keys($argument);
211211
if ($keys !== [ 'name', 'type' ]) {

tests/unit/DocBlock/Tags/MethodTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use phpDocumentor\Reflection\Types\Integer;
2323
use phpDocumentor\Reflection\Types\Object_;
2424
use phpDocumentor\Reflection\Types\String_;
25-
use phpDocumentor\Reflection\Types\Void;
25+
use phpDocumentor\Reflection\Types\Void_;
2626

2727
/**
2828
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Method
@@ -56,7 +56,7 @@ public function testIfTagCanBeRenderedUsingDefaultFormatter()
5656
['name' => 'argument1', 'type' => new String_()],
5757
['name' => 'argument2', 'type' => new Object_()]
5858
];
59-
$fixture = new Method('myMethod', $arguments, new Void(), true, new Description('My Description'));
59+
$fixture = new Method('myMethod', $arguments, new Void_(), true, new Description('My Description'));
6060

6161
$this->assertSame(
6262
'@method static void myMethod(string $argument1, object $argument2) My Description',
@@ -115,7 +115,7 @@ public function testArgumentsMayBePassedAsString()
115115
{
116116
$arguments = ['argument1'];
117117
$expected = [
118-
[ 'name' => $arguments[0], 'type' => new Void() ]
118+
[ 'name' => $arguments[0], 'type' => new Void_() ]
119119
];
120120

121121
$fixture = new Method('myMethod', $arguments);
@@ -131,7 +131,7 @@ public function testArgumentTypeCanBeInferredAsVoid()
131131
{
132132
$arguments = [ [ 'name' => 'argument1' ] ];
133133
$expected = [
134-
[ 'name' => $arguments[0]['name'], 'type' => new Void() ]
134+
[ 'name' => $arguments[0]['name'], 'type' => new Void_() ]
135135
];
136136

137137
$fixture = new Method('myMethod', $arguments);
@@ -160,7 +160,7 @@ public function testReturnTypeCanBeInferredAsVoid()
160160
{
161161
$fixture = new Method('myMethod', []);
162162

163-
$this->assertEquals(new Void(), $fixture->getReturnType());
163+
$this->assertEquals(new Void_(), $fixture->getReturnType());
164164
}
165165

166166
/**
@@ -204,7 +204,7 @@ public function testStringRepresentationIsReturned()
204204
['name' => 'argument1', 'type' => new String_()],
205205
['name' => 'argument2', 'type' => new Object_()]
206206
];
207-
$fixture = new Method('myMethod', $arguments, new Void(), true, new Description('My Description'));
207+
$fixture = new Method('myMethod', $arguments, new Void_(), true, new Description('My Description'));
208208

209209
$this->assertSame(
210210
'static void myMethod(string $argument1, object $argument2) My Description',
@@ -230,7 +230,7 @@ public function testFactoryMethod()
230230
$description = new Description('My Description');
231231
$expectedArguments = [
232232
[ 'name' => 'argument1', 'type' => new String_() ],
233-
[ 'name' => 'argument2', 'type' => new Void() ]
233+
[ 'name' => 'argument2', 'type' => new Void_() ]
234234
];
235235

236236
$descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description);
@@ -245,7 +245,7 @@ public function testFactoryMethod()
245245
$this->assertSame('static void myMethod(string $argument1, void $argument2) My Description', (string)$fixture);
246246
$this->assertSame('myMethod', $fixture->getMethodName());
247247
$this->assertEquals($expectedArguments, $fixture->getArguments());
248-
$this->assertInstanceOf(Void::class, $fixture->getReturnType());
248+
$this->assertInstanceOf(Void_::class, $fixture->getReturnType());
249249
$this->assertSame($description, $fixture->getDescription());
250250
}
251251

@@ -404,7 +404,7 @@ public function testCreateMethodParenthesisMissing()
404404
$this->assertSame('static void myMethod() My Description', (string)$fixture);
405405
$this->assertSame('myMethod', $fixture->getMethodName());
406406
$this->assertEquals([], $fixture->getArguments());
407-
$this->assertInstanceOf(Void::class, $fixture->getReturnType());
407+
$this->assertInstanceOf(Void_::class, $fixture->getReturnType());
408408
$this->assertSame($description, $fixture->getDescription());
409409
}
410410
}

0 commit comments

Comments
 (0)