Skip to content

Commit 7bab89f

Browse files
Merge pull request #4 from php-static-analysis/codex/update-dependencies-to-version-0.5.0
feat: store attribute parameters
2 parents 33ceaaf + 8af4bee commit 7bab89f

8 files changed

+10
-3
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
"php": ">=8.1",
2828
"composer-plugin-api": "^2.0",
2929
"ext-simplexml": "*",
30-
"php-static-analysis/attributes": "^0.4.1 || dev-main",
31-
"php-static-analysis/node-visitor": "^0.4.1 || dev-main",
30+
"php-static-analysis/attributes": "^0.5.0 || dev-main",
31+
"php-static-analysis/node-visitor": "^0.5.0 || dev-main",
3232
"vimeo/psalm": "^6.12",
3333
"webmozart/assert": "^1.11"
3434
},
3535
"require-dev": {
3636
"composer/composer": "^2.0",
37-
"php-static-analysis/phpstan-extension": "^0.4.1 || dev-main",
37+
"php-static-analysis/phpstan-extension": "^0.5.0 || dev-main",
3838
"phpstan/extension-installer": "^1.3",
3939
"phpstan/phpstan": "^1.8 | ^2.0",
4040
"phpunit/phpunit": "^9.0",

tests/RequireExtendsAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function testInvalidClassRequireExtendsAttribute(): void
2020
$errors = $this->analyzeTestFile( '/data/RequireExtends/InvalidTraitRequireExtendsAttribute.php');
2121

2222
$expectedErrors = [
23+
'Too many arguments for PhpStaticAnalysis\Attributes\RequireExtends::__construct - expecting 0 but saw 1' => 10,
2324
'Attribute RequireExtends cannot be used on a property' => 10,
2425
];
2526

tests/ReturnsAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function testInvalidMethodReturnsAttribute(): void
2525
'Found duplicated @return or prefixed @return tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getOtherName' => 15,
2626
'Found duplicated @return or prefixed @return tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getSomeMoreNames' => 31,
2727
'Misplaced variable in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getMoreAndMoreNames' => 37,
28+
'Too many arguments for PhpStaticAnalysis\Attributes\Returns::__construct - expecting 0 but saw 1' => 43,
2829
'Attribute Returns cannot be used on a property' => 43,
2930
]);
3031
}

tests/SelfOutAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function testInvalidMethodSelfOutAttribute(): void
1515
$errors = $this->analyzeTestFile('/data/SelfOut/InvalidMethodSelfOutAttribute.php');
1616

1717
$expectedErrors = [
18+
'Too many arguments for PhpStaticAnalysis\Attributes\SelfOut::__construct - expecting 0 but saw 1' => 20,
1819
'Attribute SelfOut cannot be used on a property' => 20,
1920
];
2021

tests/TemplateAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function testInvalidMethodTemplateAttribute(): void
4242
$this->checkExpectedErrors($errors,[
4343
'Empty @template tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Template\InvalidMethodTemplateAttribute::getName' => 11,
4444
'Empty @template tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Template\InvalidMethodTemplateAttribute::getAnotherName' => 17,
45+
'Too many arguments for PhpStaticAnalysis\Attributes\Template::__construct - expecting 0 but saw 1' => 23,
4546
'Attribute Template cannot be used on a property' => 23,
4647
]);
4748
}

tests/TemplateCovariantAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function testInvalidClassTemplateCovariantAttribute(): void
2929
$errors = $this->analyzeTestFile('/data/TemplateCovariant/InvalidClassTemplateCovariantAttribute.php');
3030
$this->checkExpectedErrors($errors,[
3131
'Empty @template-covariant tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\TemplateCovariant\InvalidClassTemplateCovariantAttribute' => 10,
32+
'Too many arguments for PhpStaticAnalysis\Attributes\TemplateCovariant::__construct - expecting 0 but saw 1' => 12,
3233
'Attribute TemplateCovariant cannot be used on a property' => 12,
3334
]);
3435
}

tests/TemplateExtendsAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function testInvalidClassTemplateExtendsAttribute(): void
1919
'test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild has missing template params when extending test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\InvalidClassTemplateExtendsAttribute, expecting 1' => 14,
2020
'Invalid type \'test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\+5\' in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild2' => 18,
2121
'test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild2 has missing template params when extending test\PhpStaticAnalysis\PsalmPlugin\data\TemplateExtends\InvalidClassTemplateExtendsAttribute, expecting 1' => 19,
22+
'Too many arguments for PhpStaticAnalysis\Attributes\TemplateExtends::__construct - expecting 0 but saw 1' => 27,
2223
'Attribute TemplateExtends cannot be used on a property' => 27,
2324
];
2425

tests/TypeAttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function testInvalidPropertyTypeAttribute(): void
1717
$errors = $this->analyzeTestFile('/data/Type/InvalidPropertyTypeAttribute.php');
1818
$this->checkExpectedErrors($errors,[
1919
'Misplaced variable' => 19,
20+
'Too many arguments for PhpStaticAnalysis\Attributes\Type::__construct - expecting 0 but saw 1' => 23,
2021
'Attribute Type cannot be used on a function/method parameter' => 23,
2122
'Property test\PhpStaticAnalysis\PsalmPlugin\data\Type\InvalidPropertyTypeAttribute::$invalidProperty does not have a declared type - consider string' => 10,
2223
'Property test\PhpStaticAnalysis\PsalmPlugin\data\Type\InvalidPropertyTypeAttribute::$andAnotherinvalidProperty does not have a declared type - consider string' => 20,

0 commit comments

Comments
 (0)