Skip to content

Commit 7931644

Browse files
author
Emil Masiakowski
committed
Drop support for phpdoc-parser v1
1 parent 188e72b commit 7931644

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"nikic/php-parser": "~5",
3232
"webmozart/assert": "^1.9",
3333
"ext-json": "*",
34-
"phpstan/phpdoc-parser": "^1.2|^2.0",
34+
"phpstan/phpdoc-parser": "^2.0",
3535
"ondram/ci-detector": "^4.1"
3636
},
3737
"require-dev": {
@@ -60,4 +60,4 @@
6060
"bin": [
6161
"bin-stub/phparkitect"
6262
]
63-
}
63+
}

src/Analyzer/NameResolver.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,11 @@ public function __construct(?ErrorHandler $errorHandler = null, array $options =
6666
$this->replaceNodes = $options['replaceNodes'] ?? true;
6767
$this->parseCustomAnnotations = $options['parseCustomAnnotations'] ?? true;
6868

69-
if (class_exists(ParserConfig::class)) {
70-
$parserConfig = new ParserConfig([]);
71-
$constExprParser = new ConstExprParser($parserConfig);
72-
$typeParser = new TypeParser($parserConfig, $constExprParser);
73-
$this->phpDocParser = new PhpDocParser($parserConfig, $typeParser, $constExprParser);
74-
$this->phpDocLexer = new Lexer($parserConfig);
75-
} else {
76-
$typeParser = new TypeParser();
77-
$constExprParser = new ConstExprParser();
78-
$this->phpDocParser = new PhpDocParser($typeParser, $constExprParser);
79-
$this->phpDocLexer = new Lexer();
80-
}
69+
$parserConfig = new ParserConfig([]);
70+
$constExprParser = new ConstExprParser($parserConfig);
71+
$typeParser = new TypeParser($parserConfig, $constExprParser);
72+
$this->phpDocParser = new PhpDocParser($parserConfig, $typeParser, $constExprParser);
73+
$this->phpDocLexer = new Lexer($parserConfig);
8174
}
8275

8376
/**

0 commit comments

Comments
 (0)