Skip to content

Commit 2894799

Browse files
committed
Open 2.0.x
1 parent 9d053a8 commit 2894799

File tree

5 files changed

+13
-20
lines changed

5 files changed

+13
-20
lines changed

.github/workflows/backward-compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
push:
88
branches:
9-
- "1.23.x"
9+
- "2.0.x"
1010

1111
jobs:
1212
backward-compatibility:

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
push:
88
branches:
9-
- "1.23.x"
9+
- "2.0.x"
1010

1111
jobs:
1212
lint:

.github/workflows/test-slevomat-coding-standard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
push:
88
branches:
9-
- "1.23.x"
9+
- "2.0.x"
1010

1111
jobs:
1212
tests:

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"description": "PHPDoc parser with support for nullable, intersection and generic types",
44
"license": "MIT",
55
"require": {
6-
"php": "^7.2 || ^8.0"
6+
"php": "^7.4 || ^8.0"
77
},
88
"require-dev": {
99
"doctrine/annotations": "^2.0",
10-
"nikic/php-parser": "^4.15",
10+
"nikic/php-parser": "^5.1",
1111
"php-parallel-lint/php-parallel-lint": "^1.2",
1212
"phpstan/extension-installer": "^1.0",
13-
"phpstan/phpstan": "^1.5",
14-
"phpstan/phpstan-phpunit": "^1.1",
15-
"phpstan/phpstan-strict-rules": "^1.0",
16-
"phpunit/phpunit": "^9.5",
13+
"phpstan/phpstan": "^2.0",
14+
"phpstan/phpstan-phpunit": "^2.0",
15+
"phpstan/phpstan-strict-rules": "^2.0",
16+
"phpunit/phpunit": "^9.6",
1717
"symfony/process": "^5.2"
1818
},
1919
"config": {

tests/PHPStan/Printer/IntegrationPrinterWithPhpParserTest.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
namespace PHPStan\PhpDocParser\Printer;
44

55
use PhpParser\Comment\Doc;
6-
use PhpParser\Lexer\Emulative;
76
use PhpParser\Node as PhpNode;
87
use PhpParser\NodeTraverser as PhpParserNodeTraverser;
98
use PhpParser\NodeVisitor\CloningVisitor as PhpParserCloningVisitor;
109
use PhpParser\NodeVisitorAbstract;
11-
use PhpParser\Parser\Php7;
10+
use PhpParser\ParserFactory;
1211
use PHPStan\PhpDocParser\Ast\AbstractNodeVisitor;
1312
use PHPStan\PhpDocParser\Ast\Node;
1413
use PHPStan\PhpDocParser\Ast\NodeTraverser;
@@ -66,14 +65,8 @@ public function enterNode(Node $node)
6665
*/
6766
public function testPrint(string $file, string $expectedFile, NodeVisitor $visitor): void
6867
{
69-
$lexer = new Emulative([
70-
'usedAttributes' => [
71-
'comments',
72-
'startLine', 'endLine',
73-
'startTokenPos', 'endTokenPos',
74-
],
75-
]);
76-
$phpParser = new Php7($lexer);
68+
$phpParserFactory = new ParserFactory();
69+
$phpParser = $phpParserFactory->createForNewestSupportedVersion();
7770
$phpTraverser = new PhpParserNodeTraverser();
7871
$phpTraverser->addVisitor(new PhpParserCloningVisitor());
7972

@@ -85,7 +78,7 @@ public function testPrint(string $file, string $expectedFile, NodeVisitor $visit
8578

8679
/** @var PhpNode[] $oldStmts */
8780
$oldStmts = $phpParser->parse($fileContents);
88-
$oldTokens = $lexer->getTokens();
81+
$oldTokens = $phpParser->getTokens();
8982

9083
$phpTraverser2 = new PhpParserNodeTraverser();
9184
$phpTraverser2->addVisitor(new class ($visitor) extends NodeVisitorAbstract {

0 commit comments

Comments
 (0)