Skip to content

Commit c406baa

Browse files
Update to PHPStan 2.0
1 parent b62b26c commit c406baa

35 files changed

+119
-47
lines changed

.github/workflows/all_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php-version:
17-
- "8.0"
1817
- "8.1"
1918
- "8.2"
2019
- "8.3"
20+
- "8.4"
2121

2222
steps:
2323
- name: "Checkout"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ composer.lock
33
.phpunit.result.cache
44
.idea
55
cache
6+
.codebase_patch_applied
7+
.config_patch_applied

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ However, static analysis tools like Psalm have not made this transition to attri
1010

1111
This is a Psalm plugin that allows Psalm to understand a new set of attributes that replace the PHPDoc annotations. These attributes are defined in [this repository](https://github.com/php-static-analysis/attributes)
1212

13+
NOTE: Version 0.4.0 of this plugin requires Php Parser v5. The current available version of Psalm (v5) does not support this
14+
version of the parser, so currently this library only supports the `dev-master` version of Psalm. If you need to
15+
use Psalm 5, you will need to use version 0.3 of this plugin.
16+
1317
## Example
1418

1519
In order to show how code would look with these attributes, we can look at the following example. This is how a class looks like with the current annotations:
@@ -74,6 +78,12 @@ To use this plugin, require it in Composer:
7478
composer require --dev php-static-analysis/psalm-plugin
7579
```
7680

81+
NOTE: When adding this dependency, composer will ask you
82+
if you want to allow this dependency as a composer plugin.
83+
This is needed so that this plugin can patch Psalm in order
84+
to enable its functionality. This will add an entry in your
85+
`allow-plugins` composer config entry.
86+
7787
Then run this command to enable the plugin:
7888

7989
```

composer.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "php-static-analysis/psalm-plugin",
33
"description": "Psalm plugin to read static analysis attributes",
4-
"type": "psalm-plugin",
4+
"type": "composer-plugin",
55
"keywords": ["dev", "static analysis"],
66
"license": "MIT",
77
"autoload": {
@@ -24,17 +24,19 @@
2424
"minimum-stability": "dev",
2525
"prefer-stable": true,
2626
"require": {
27-
"php": ">=8.0",
27+
"php": ">=8.1",
28+
"composer-plugin-api": "^2.0",
2829
"ext-simplexml": "*",
29-
"php-static-analysis/attributes": "^0.3.1 || dev-main",
30-
"php-static-analysis/node-visitor": "^0.3.1 || dev-main",
31-
"vimeo/psalm": "^5",
30+
"php-static-analysis/attributes": "^0.3.2 || dev-main",
31+
"php-static-analysis/node-visitor": "^0.3.2 || dev-main",
32+
"vimeo/psalm": "dev-master",
3233
"webmozart/assert": "^1.11"
3334
},
3435
"require-dev": {
35-
"php-static-analysis/phpstan-extension": "dev-main",
36+
"composer/composer": "^2.0",
37+
"php-static-analysis/phpstan-extension": "^0.3.2 || dev-main",
3638
"phpstan/extension-installer": "^1.3",
37-
"phpstan/phpstan": "^1.10",
39+
"phpstan/phpstan": "^1.8 | ^2.0",
3840
"phpunit/phpunit": "^9.0",
3941
"symplify/easy-coding-standard": "^12.1"
4042
},
@@ -50,7 +52,8 @@
5052
"extra": {
5153
"psalm": {
5254
"pluginClass": "PhpStaticAnalysis\\PsalmPlugin\\Plugin"
53-
}
55+
},
56+
"class": "PhpStaticAnalysis\\PsalmPlugin\\Composer\\Plugin"
5457
},
5558
"scripts": {
5659
"tests": [
@@ -64,6 +67,8 @@
6467
"ecs": "ecs",
6568
"ecs-fix": "ecs --fix",
6669
"phpunit": "phpunit",
67-
"phpstan": "phpstan analyse"
70+
"phpstan": "phpstan analyse",
71+
"post-install-cmd": "PhpStaticAnalysis\\PsalmPlugin\\Composer\\Plugin::onPostInstall",
72+
"post-update-cmd": "PhpStaticAnalysis\\PsalmPlugin\\Composer\\Plugin::onPostUpdate"
6873
}
6974
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- /dev/null
2+
+++ ../src/Psalm/Codebase.php
3+
@@ -131,7 +131,10 @@
4+
5+
public FileReferenceProvider $file_reference_provider;
6+
7+
- public StatementsProvider $statements_provider;
8+
+ /**
9+
+ * @var StatementsProvider
10+
+ */
11+
+ public $statements_provider;
12+
13+
private readonly Progress $progress;
14+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- /dev/null
2+
+++ ../src/Psalm/Config.php
3+
@@ -130,7 +130,7 @@
4+
* @psalm-suppress PropertyNotSetInConstructor
5+
* @psalm-consistent-constructor
6+
*/
7+
-final class Config
8+
+class Config
9+
{
10+
final public const DEFAULT_BASELINE_NAME = 'psalm-baseline.xml';
11+
private const DEFAULT_FILE_NAMES = [

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ parameters:
44
- src
55
- tests
66
excludePaths:
7-
- tests/data/*
7+
- tests/data/*

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<directory name="src" />
1313
<directory name="tests" />
1414
<ignoreFiles>
15-
<directory name="vendor" />
1615
<directory name="tests/data" />
1716
</ignoreFiles>
1817
</projectFiles>

src/Composer/Plugin.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
namespace PhpStaticAnalysis\PsalmPlugin\Composer;
4+
5+
use Composer\Composer;
6+
use Composer\EventDispatcher\EventSubscriberInterface;
7+
use Composer\IO\IOInterface;
8+
use Composer\Plugin\PluginInterface;
9+
use Composer\Script\Event;
10+
use PhpStaticAnalysis\Attributes\Returns;
11+
12+
class Plugin implements PluginInterface, EventSubscriberInterface
13+
{
14+
public function activate(Composer $composer, IOInterface $io)
15+
{
16+
}
17+
18+
public function deactivate(Composer $composer, IOInterface $io)
19+
{
20+
}
21+
22+
public function uninstall(Composer $composer, IOInterface $io)
23+
{
24+
}
25+
26+
#[Returns('array<string, string>')]
27+
public static function getSubscribedEvents(): array
28+
{
29+
return [
30+
'post-install-cmd' => 'onPostInstall',
31+
'post-update-cmd' => 'onPostUpdate'
32+
];
33+
}
34+
35+
public static function onPostInstall(Event $event): void
36+
{
37+
self::applyPatches($event);
38+
}
39+
40+
public static function onPostUpdate(Event $event): void
41+
{
42+
self::applyPatches($event);
43+
}
44+
45+
private static function applyPatches(Event $event): void
46+
{
47+
/**
48+
* @var string $vendorDir
49+
*/
50+
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
51+
52+
$dependencyPath = $vendorDir . '/vimeo/psalm';
53+
$patchFile = __DIR__ . '/../../patches/vimeo-psalm-src-psalm-config-php.patch';
54+
55+
exec("patch -p1 -d $dependencyPath --forward < $patchFile");
56+
57+
$patchFile = __DIR__ . '/../../patches/vimeo-psalm-src-psalm-codebase-php.patch';
58+
59+
exec("patch -p1 -d $dependencyPath --forward < $patchFile");
60+
}
61+
}

src/Provider/AttributeStatementProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getStatementsForFile(
3838
return $this->traverseAst($ast);
3939
}
4040

41-
#[Param(args: 'mixed[]')]
41+
#[Param(args: 'array<int|string, mixed>')]
4242
public function __call(string $method, array $args): mixed
4343
{
4444
$callable = [$this->statementsProvider, $method];

tests/AssertAttributeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testInvalidMethodAssertAttribute(): void
2222
{
2323
$errors = $this->analyzeTestFile('/data/Assert/InvalidMethodAssertAttribute.php');
2424
$this->checkExpectedErrors($errors,[
25-
'Argument 1 of PhpStaticAnalysis\Attributes\Assert::__construct expects string, but 0 provided' => 9,
25+
'Misplaced variable in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Assert\InvalidMethodAssertAttribute::checkString' => 9,
2626
'Attribute Assert cannot be used on a property' => 14,
2727
]);
2828
}

tests/AssertIfFalseAttributeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testInvalidMethodAssertIfFalseAttribute(): void
2222
{
2323
$errors = $this->analyzeTestFile('/data/AssertIfFalse/InvalidMethodAssertIfFalseAttribute.php');
2424
$this->checkExpectedErrors($errors,[
25-
'Argument 1 of PhpStaticAnalysis\Attributes\AssertIfFalse::__construct expects string, but 0 provided' => 9,
25+
'Misplaced variable in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\AssertIfFalse\InvalidMethodAssertIfFalseAttribute::checkString' => 9,
2626
'Attribute AssertIfFalse cannot be used on a property' => 15,
2727
]);
2828
}

tests/AssertIfTrueAttributeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testInvalidMethodAssertIfTrueAttribute(): void
2222
{
2323
$errors = $this->analyzeTestFile('/data/AssertIfTrue/InvalidMethodAssertIfTrueAttribute.php');
2424
$this->checkExpectedErrors($errors,[
25-
'Argument 1 of PhpStaticAnalysis\Attributes\AssertIfTrue::__construct expects string, but 0 provided' => 9,
25+
'Misplaced variable in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\AssertIfTrue\InvalidMethodAssertIfTrueAttribute::checkString' => 9,
2626
'Attribute AssertIfTrue cannot be used on a property' => 15,
2727
]);
2828
}

tests/BaseAttributeTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function checkExpectedErrors(
7474

7575
$errorNum = 0;
7676
foreach ($expectedErrors as $error => $line) {
77-
/** @psalm-suppress InternalProperty */
77+
/** @psalm-suppress InternalProperty, UndefinedPropertyFetch */
7878
$this->assertSame($error, $errors[$errorNum]->message);
7979
/** @psalm-suppress InternalProperty */
8080
$this->assertSame($line, $errors[$errorNum]->line_from);

tests/DefineTypeAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testInvalidClassDefineTypeAttribute(): void
2828

2929
$expectedErrors = [
3030
'Misplaced brackets' => 7,
31-
'Argument 1 of PhpStaticAnalysis\Attributes\DefineType::__construct expects string, but 0 provided' => 7,
3231
'Attribute DefineType cannot be used on a method' => 12,
3332
];
3433

tests/DeprecatedAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function testInvalidMethodDeprecatedAttribute(): void
5454

5555
$expectedErrors = [
5656
'Attribute Deprecated cannot be used on a function/method parameter' => 12,
57-
'Attribute Deprecated is not repeatable' => 19,
5857
];
5958

6059
$this->checkExpectedErrors($errors, $expectedErrors);

tests/ImmutableAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function testInvalidClassImmutableAttribute(): void
3232
$errors = $this->analyzeTestFile( '/data/Immutable/InvalidClassImmutableAttribute.php');
3333

3434
$expectedErrors = [
35-
'Attribute Immutable is not repeatable' => 10,
3635
'Attribute Immutable cannot be used on a property' => 13,
3736
];
3837

tests/ImportTypeAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function testInvalidClassImportTypeAttribute(): void
2929
$expectedErrors = [
3030
'Invalid import in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\ImportType\InvalidClassImportTypeAttribute, expecting "<TypeName> from <ClassName>", got "" instead.' => 9,
3131
'Invalid import in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\ImportType\InvalidClassImportTypeAttribute, expecting "<TypeName> from <ClassName>", got "string" instead.' => 10,
32-
'Argument 1 of PhpStaticAnalysis\Attributes\ImportType::__construct expects string, but 0 provided' => 8,
3332
'Attribute ImportType cannot be used on a method' => 13,
3433
'Docblock-defined class, interface or enum named test\PhpStaticAnalysis\PsalmPlugin\data\ImportType\count($a) does not exist' => 11,
3534
];

tests/InternalAttributeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public function testInvalidMethodInternalAttribute(): void
4949
$errors = $this->analyzeTestFile('/data/Internal/InvalidMethodInternalAttribute.php');
5050
$expectedErrors = [
5151
'psalm-internal annotation used without specifying namespace in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Internal\InvalidMethodInternalAttribute::getName' => 9,
52-
'Argument 1 of PhpStaticAnalysis\Attributes\Internal::__construct expects null|string, but 0 provided' => 9,
5352
'Attribute Internal cannot be used on a function/method parameter' => 15,
54-
'Attribute Internal is not repeatable' => 22,
5553
];
5654

5755
$this->checkExpectedErrors($errors, $expectedErrors);

tests/IsReadOnlyAttributeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public function testInvalidPropertyIsReadOnlyAttribute(): void
1919
$errors = $this->analyzeTestFile('/data/IsReadOnly/InvalidPropertyIsReadOnlyAttribute.php');
2020
$this->checkExpectedErrors($errors,[
2121
'Attribute IsReadOnly cannot be used on a method' => 16,
22-
'Too many arguments for PhpStaticAnalysis\Attributes\IsReadOnly::__construct - expecting 0 but saw 1' => 9,
23-
'Attribute IsReadOnly is not repeatable' => 13,
2422
]);
2523
}
2624
}

tests/MethodAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testInvalidClassMethodAttribute(): void
2828

2929
$expectedErrors = [
3030
'No @method entry specified in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Method\InvalidClassMethodAttribute' => 9,
31-
'Argument 1 of PhpStaticAnalysis\Attributes\Method::__construct expects string, but 0 provided' => 8,
3231
'Attribute Method cannot be used on a method' => 11,
3332
'string is not a valid method in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Method\AnotherInvalidClassMethodAttribute' => 29,
3433
];

tests/MixinAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testInvalidClassMixinAttribute(): void
2828

2929
$expectedErrors = [
3030
'@mixin annotation used without specifying class in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Mixin\InvalidClassMixinAttribute' => 9,
31-
'Argument 1 of PhpStaticAnalysis\Attributes\Mixin::__construct expects string, but 0 provided' => 7,
3231
'Attribute Mixin cannot be used on a method' => 11,
3332
];
3433

tests/ParamAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public function testInvalidMethodParamAttribute(): void
2424
$this->checkExpectedErrors($errors,[
2525
'Badly-formatted @param in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Param\InvalidMethodParamAttribute::getNameLength' => 9,
2626
'Badly-formatted @param in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Param\InvalidMethodParamAttribute::getOtherNameLength' => 15,
27-
'Argument 1 of PhpStaticAnalysis\Attributes\Param::__construct expects string, but 0 provided' => 9,
2827
'Misplaced brackets in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Param\InvalidMethodParamAttribute::getAnotherNameLength' => 22,
2928
'Found duplicated @param or prefixed @param tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Param\InvalidMethodParamAttribute::countEvenMoreNames' => 30,
3029
'Argument 1 of count cannot be mixed, expecting Countable|array<array-key, mixed>' => 33,

tests/ParamOutAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public function testInvalidMethodParamOutAttribute(): void
2323
$expectedErrors = [
2424
'Badly-formatted @param in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\ParamOut\InvalidMethodParamOutAttribute::setName' => 9,
2525
'Badly-formatted @param in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\ParamOut\InvalidMethodParamOutAttribute::setOtherName' => 15,
26-
'Argument 1 of PhpStaticAnalysis\Attributes\ParamOut::__construct expects string, but 0 provided' => 9,
2726
'Misplaced brackets in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\ParamOut\InvalidMethodParamOutAttribute::setAnotherName' => 21,
2827
'Attribute ParamOut cannot be used on a property' => 27,
2928
];

tests/PropertyAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testInvalidClassPropertyAttribute(): void
2828

2929
$expectedErrors = [
3030
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Property\InvalidClassPropertyAttribute' => 8,
31-
'Argument 1 of PhpStaticAnalysis\Attributes\Property::__construct expects string, but 0 provided' => 7,
3231
'Attribute Property cannot be used on a method' => 10,
3332
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Property\AnotherInvalidClassPropertyAttribute' => 18,
3433
'Misplaced brackets in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Property\AndAnotherInvalidClassPropertyAttribute' => 23,

tests/PropertyReadAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testInvalidClassPropertyReadAttribute(): void
2828

2929
$expectedErrors = [
3030
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyRead\InvalidClassPropertyReadAttribute' => 9,
31-
'Argument 1 of PhpStaticAnalysis\Attributes\PropertyRead::__construct expects string, but 0 provided' => 7,
3231
'Attribute PropertyRead cannot be used on a method' => 11,
3332
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyRead\AnotherInvalidClassPropertyReadAttribute' => 29,
3433
'Misplaced brackets in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyRead\AndAnotherInvalidClassPropertyReadAttribute' => 34,

tests/PropertyWriteAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function testInvalidClassPropertyWriteAttribute(): void
2929
$expectedErrors = [
3030
'Unable to determine the type that $foo is being assigned to' => 39,
3131
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyWrite\InvalidClassPropertyWriteAttribute' => 9,
32-
'Argument 1 of PhpStaticAnalysis\Attributes\PropertyWrite::__construct expects string, but 0 provided' => 7,
3332
'Attribute PropertyWrite cannot be used on a method' => 11,
3433
'Badly-formatted @property in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyWrite\AnotherInvalidClassPropertyWriteAttribute' => 29,
3534
'Misplaced brackets in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\PropertyWrite\AndAnotherInvalidClassPropertyWriteAttribute' => 34,

tests/PureAttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function testInvalidMethodPureAttribute(): void
2121
$errors = $this->analyzeTestFile('/data/Pure/InvalidMethodPureAttribute.php');
2222

2323
$expectedErrors = [
24-
'Attribute Pure is not repeatable' => 15,
2524
'Attribute Pure cannot be used on a property' => 11,
2625
];
2726

tests/ReturnsAttributeTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ public function testInvalidMethodReturnsAttribute(): void
2222
{
2323
$errors = $this->analyzeTestFile('/data/Returns/InvalidMethodReturnsAttribute.php');
2424
$this->checkExpectedErrors($errors,[
25-
'Argument 1 of PhpStaticAnalysis\Attributes\Returns::__construct expects string, but 0 provided' => 9,
2625
'Found duplicated @return or prefixed @return tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getOtherName' => 15,
27-
'Attribute Returns is not repeatable' => 16,
28-
'Too many arguments for PhpStaticAnalysis\Attributes\Returns::__construct - expecting 1 but saw 2' => 22,
2926
'Found duplicated @return or prefixed @return tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getSomeMoreNames' => 31,
3027
'Misplaced variable in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Returns\InvalidMethodReturnsAttribute::getMoreAndMoreNames' => 37,
3128
'Attribute Returns cannot be used on a property' => 43,

tests/SelfOutAttributeTest.php

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

1717
$expectedErrors = [
18-
'Attribute SelfOut is not repeatable' => 15,
1918
'Attribute SelfOut cannot be used on a property' => 20,
2019
];
2120

tests/TemplateAttributeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ public function testInvalidMethodTemplateAttribute(): void
4141
$errors = $this->analyzeTestFile('/data/Template/InvalidMethodTemplateAttribute.php');
4242
$this->checkExpectedErrors($errors,[
4343
'Empty @template tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Template\InvalidMethodTemplateAttribute::getName' => 11,
44-
'Argument 1 of PhpStaticAnalysis\Attributes\Template::__construct expects string, but 0 provided' => 11,
4544
'Empty @template tag in docblock for test\PhpStaticAnalysis\PsalmPlugin\data\Template\InvalidMethodTemplateAttribute::getAnotherName' => 17,
46-
'Argument 2 of PhpStaticAnalysis\Attributes\Template::__construct expects null|string, but 0 provided' => 26,
4745
'Attribute Template cannot be used on a property' => 23,
4846
]);
4947
}

0 commit comments

Comments
 (0)