Skip to content

Commit 56f2603

Browse files
committed
Support php 8.1
1 parent 5df29ef commit 56f2603

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

src/MissingToken.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66

77
namespace Microsoft\PhpParser;
88

9+
use ReturnTypeWillChange;
10+
911
class MissingToken extends Token {
1012
public function __construct(int $kind, int $fullStart) {
1113
parent::__construct($kind, $fullStart, $fullStart, 0);
1214
}
1315

16+
#[ReturnTypeWillChange]
1417
public function jsonSerialize() {
1518
return array_merge(
1619
["error" => $this->getTokenKindNameFromValue(TokenKind::MissingToken)],

src/Node.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Microsoft\PhpParser\Node\SourceFileNode;
1212
use Microsoft\PhpParser\Node\Statement\NamespaceDefinition;
1313
use Microsoft\PhpParser\Node\Statement\NamespaceUseDeclaration;
14+
use ReturnTypeWillChange;
1415

1516
abstract class Node implements \JsonSerializable {
1617
const CHILD_NAMES = [];
@@ -380,6 +381,7 @@ protected function getChildrenKvPairs() {
380381
return $result;
381382
}
382383

384+
#[ReturnTypeWillChange]
383385
public function jsonSerialize() {
384386
$kindName = $this->getNodeKindName();
385387
return ["$kindName" => $this->getChildrenKvPairs()];

src/SkippedToken.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66

77
namespace Microsoft\PhpParser;
88

9+
use ReturnTypeWillChange;
10+
911
class SkippedToken extends Token {
1012
public function __construct(Token $token) {
1113
parent::__construct($token->kind, $token->fullStart, $token->start, $token->length);
1214
}
1315

16+
#[ReturnTypeWillChange]
1417
public function jsonSerialize() {
1518
return array_merge(
1619
["error" => $this->getTokenKindNameFromValue(TokenKind::SkippedToken)],

src/Token.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Microsoft\PhpParser;
88

9+
use ReturnTypeWillChange;
10+
911
use function substr;
1012

1113
class Token implements \JsonSerializable {
@@ -110,6 +112,7 @@ public static function getTokenKindNameFromValue($kind) {
110112
return $mapToKindName[$kind] ?? $kind;
111113
}
112114

115+
#[ReturnTypeWillChange]
113116
public function jsonSerialize() {
114117
$kindName = $this->getTokenKindNameFromValue($this->kind);
115118

0 commit comments

Comments
 (0)