Skip to content

Commit 02f2732

Browse files
committed
phpstan/phpdoc-parser 1.7
1 parent a2ea28b commit 02f2732

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

SlevomatCodingStandard/Helpers/Annotation/AssertAnnotation.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace SlevomatCodingStandard\Helpers\Annotation;
44

55
use InvalidArgumentException;
6+
use PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagMethodValueNode;
7+
use PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagPropertyValueNode;
68
use PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagValueNode;
79
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
810
use SlevomatCodingStandard\Helpers\AnnotationTypeHelper;
@@ -15,10 +17,13 @@
1517
class AssertAnnotation extends Annotation
1618
{
1719

18-
/** @var AssertTagValueNode|null */
20+
/** @var AssertTagValueNode|AssertTagPropertyValueNode|AssertTagMethodValueNode|null */
1921
private $contentNode;
2022

21-
public function __construct(string $name, int $startPointer, int $endPointer, ?string $content, ?AssertTagValueNode $contentNode)
23+
/**
24+
* @param AssertTagValueNode|AssertTagPropertyValueNode|AssertTagMethodValueNode|null $contentNode
25+
*/
26+
public function __construct(string $name, int $startPointer, int $endPointer, ?string $content, $contentNode)
2227
{
2328
if (!in_array(
2429
$name,
@@ -38,7 +43,10 @@ public function isInvalid(): bool
3843
return $this->contentNode === null;
3944
}
4045

41-
public function getContentNode(): AssertTagValueNode
46+
/**
47+
* @return AssertTagMethodValueNode|AssertTagPropertyValueNode|AssertTagValueNode|null
48+
*/
49+
public function getContentNode()
4250
{
4351
$this->errorWhenInvalid();
4452

build/PHPStan/phpstan.neon

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ parameters:
2424
count: 1
2525
path: %currentWorkingDirectory%/SlevomatCodingStandard/Sniffs/ControlStructures/AssignmentInConditionSniff.php
2626
-
27-
message: '#Parameter \#5 \$contentNode of class SlevomatCodingStandard\\Helpers\\Annotation\\\w+Annotation constructor expects PHPStan\\PhpDocParser\\Ast\\PhpDoc\\\w+TagValueNode\|null, PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\|null given.#'
28-
count: 13
27+
message: '#Parameter \#5 \$contentNode of class SlevomatCodingStandard\\Helpers\\Annotation\\\w+Annotation constructor expects PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\\\w+(?:\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\\\w+)*\\|null, PHPStan\\PhpDocParser\\Ast\\PhpDoc\\PhpDocTagValueNode\|null given.#'
28+
count: 14
2929
path: %currentWorkingDirectory%/SlevomatCodingStandard/Helpers/AnnotationHelper.php
3030
-
31-
message: "#^Access to an undefined property PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\AssertTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\MixinTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\ParamTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\PropertyTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\ReturnTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\ThrowsTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\TypeAliasTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\TypelessParamTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\VarTagValueNode\\:\\:\\$type\\.$#"
32-
count: 1
33-
path: %currentWorkingDirectory%/SlevomatCodingStandard/Helpers/AnnotationHelper.php
34-
-
35-
message: "#^Parameter \\#5 \\$contentNode of class SlevomatCodingStandard\\\\Helpers\\\\Annotation\\\\ParameterAnnotation constructor expects PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\ParamTagValueNode\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\TypelessParamTagValueNode\\|null, PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\PhpDocTagValueNode\\|null given\\.$#"
31+
message: "#^Access to an undefined property PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\\\w+(?:\\|PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\\\w+)*\\:\\:\\$type\\.$#"
3632
count: 1
3733
path: %currentWorkingDirectory%/SlevomatCodingStandard/Helpers/AnnotationHelper.php
3834

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": "^7.2 || ^8.0",
1919
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
20-
"phpstan/phpdoc-parser": "^1.6.2",
20+
"phpstan/phpdoc-parser": ">=1.7.0 <1.8.0",
2121
"squizlabs/php_codesniffer": "^3.7.1"
2222
},
2323
"require-dev": {

0 commit comments

Comments
 (0)