Skip to content

Commit

Permalink
Bump PHPStan PHPDoc parser to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ruudk committed Nov 21, 2024
1 parent a093b21 commit 8e0ec13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"doctrine/instantiator": "^1.3.1 || ^2.0",
"doctrine/lexer": "^2.0 || ^3.0",
"jms/metadata": "^2.6",
"phpstan/phpdoc-parser": "^1.20"
"phpstan/phpdoc-parser": "^2.0"
},
"suggest": {
"doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.",
Expand All @@ -37,17 +37,18 @@
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/annotations": "^1.14 || ^2.0",
"slevomat/coding-standard": "dev-master#f2cc4c553eae68772624ffd7dd99022343b69c31 as 8.11.9999",
"doctrine/coding-standard": "^12.0",
"doctrine/orm": "^2.14 || ^3.0",
"doctrine/persistence": "^2.5.2 || ^3.0",
"doctrine/phpcr-odm": "^1.5.2 || ^2.0",
"jackalope/jackalope-doctrine-dbal": "^1.3",
"ocramius/proxy-manager": "^1.0 || ^2.0",
"phpbench/phpbench": "^1.0",
"phpstan/phpstan": "^1.10.57",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0",
"psr/container": "^1.0 || ^2.0",
"rector/rector": "^1.0.0",
"rector/rector": "dev-main#d593c5af24b9ca2da9b7595125dca713f6032bac as 2.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/expression-language": "^5.4 || ^6.0 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
Expand Down
11 changes: 7 additions & 4 deletions src/Metadata/Driver/DocBlockDriver/DocBlockTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use PHPStan\PhpDocParser\Parser\PhpDocParser;
use PHPStan\PhpDocParser\Parser\TokenIterator;
use PHPStan\PhpDocParser\Parser\TypeParser;
use PHPStan\PhpDocParser\ParserConfig;

/**
* @internal
Expand Down Expand Up @@ -47,11 +48,13 @@ final class DocBlockTypeResolver

public function __construct()
{
$constExprParser = new ConstExprParser();
$typeParser = new TypeParser($constExprParser);
$config = new ParserConfig( ['lines' => true, 'indexes' => true]);

Check failure on line 51 in src/Metadata/Driver/DocBlockDriver/DocBlockTypeResolver.php

View workflow job for this annotation

GitHub Actions / Coding Standards (7.4)

Space after opening parenthesis of function call prohibited

$this->phpDocParser = new PhpDocParser($typeParser, $constExprParser);
$this->lexer = new Lexer();
$constExprParser = new ConstExprParser($config);
$typeParser = new TypeParser($config, $constExprParser);

$this->phpDocParser = new PhpDocParser($config, $typeParser, $constExprParser);
$this->lexer = new Lexer($config);
}

/**
Expand Down

0 comments on commit 8e0ec13

Please sign in to comment.