Skip to content

Commit 49c4c4b

Browse files
committed
downgrade to PHP 7.0.x
1 parent 61d37ab commit 49c4c4b

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "phpstan/phpdoc-parser",
33
"license": "MIT",
4+
"require": {
5+
"php": "~7.0"
6+
},
47
"autoload": {
58
"psr-4": {"PHPStan\\PhpDocParser\\": ["src/"]}
69
}

src/Ast/ConstExpr/ConstExprArrayItemNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ConstExprArrayItemNode implements ConstExprNode
1212
public $value;
1313

1414

15-
public function __construct(?ConstExprNode $key, ConstExprNode $value)
15+
public function __construct(ConstExprNode $key = null, ConstExprNode $value)
1616
{
1717
$this->key = $key;
1818
$this->value = $value;

src/Ast/PhpDoc/MethodTagValueNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MethodTagValueNode implements PhpDocTagValueNode
2323
public $description;
2424

2525

26-
public function __construct(bool $isStatic, ?TypeNode $returnType, string $methodName, array $parameters, string $description)
26+
public function __construct(bool $isStatic, TypeNode $returnType = null, string $methodName, array $parameters, string $description)
2727
{
2828
$this->isStatic = $isStatic;
2929
$this->returnType = $returnType;

src/Ast/PhpDoc/MethodTagValueParameterNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MethodTagValueParameterNode implements Node
2525
public $defaultValue;
2626

2727

28-
public function __construct(?TypeNode $type, bool $isReference, bool $isVariadic, string $parameterName, ?ConstExprNode $defaultValue)
28+
public function __construct(TypeNode $type = null, bool $isReference, bool $isVariadic, string $parameterName, ConstExprNode $defaultValue = null)
2929
{
3030
$this->type = $type;
3131
$this->isReference = $isReference;

src/Lexer/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function tokenize(string $s): array
105105
}
106106

107107

108-
private function initialize(): void
108+
private function initialize()
109109
{
110110
$patterns = [
111111
// '&' followed by TOKEN_VARIADIC or TOKEN_VARIABLE

src/Parser/TokenIterator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function isCurrentTokenType(int $tokenType): bool
7878
/**
7979
* @throws ParserException
8080
*/
81-
public function consumeTokenType(int $tokenType): void
81+
public function consumeTokenType(int $tokenType)
8282
{
8383
if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) {
8484
$this->throwError($tokenType);
@@ -140,7 +140,7 @@ public function joinUntil(int ...$tokenType): string
140140
}
141141

142142

143-
public function next(): void
143+
public function next()
144144
{
145145
$this->index++;
146146

@@ -150,19 +150,19 @@ public function next(): void
150150
}
151151

152152

153-
public function pushSavePoint(): void
153+
public function pushSavePoint()
154154
{
155155
$this->savePoints[] = $this->index;
156156
}
157157

158158

159-
public function dropSavePoint(): void
159+
public function dropSavePoint()
160160
{
161161
array_pop($this->savePoints);
162162
}
163163

164164

165-
public function rollback(): void
165+
public function rollback()
166166
{
167167
$this->index = array_pop($this->savePoints);
168168
}
@@ -171,7 +171,7 @@ public function rollback(): void
171171
/**
172172
* @throws ParserException
173173
*/
174-
private function throwError(int $expectedTokenType): void
174+
private function throwError(int $expectedTokenType)
175175
{
176176
throw new ParserException(sprintf(
177177
'Unexpected token \'%s\', expected %s at offset %d',

0 commit comments

Comments
 (0)