mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Merge pull request #9445 from weirdan/8.2-attributes
PHP 8.2 attributes moved to 8.2 stub
This commit is contained in:
commit
3af9ccde91
@ -531,14 +531,3 @@ final class ReturnTypeWillChange
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
#[Attribute(Attribute::TARGET_PARAMETER)]
|
||||
final class SensitiveParameter
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
#[Attribute(Attribute::TARGET_CLASS)]
|
||||
final class AllowDynamicProperties
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
@ -33,4 +33,16 @@ namespace {
|
||||
/** @psalm-return (Start is string ? Iterator<int, DateTime> : Iterator<int, Start>) */
|
||||
public function getIterator(): Iterator {}
|
||||
}
|
||||
|
||||
#[Attribute(Attribute::TARGET_PARAMETER)]
|
||||
final class SensitiveParameter
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
#[Attribute(Attribute::TARGET_CLASS)]
|
||||
final class AllowDynamicProperties
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
}
|
||||
|
@ -263,6 +263,9 @@ class AttributeTest extends TestCase
|
||||
class Foo
|
||||
{}
|
||||
',
|
||||
'assertions' => [],
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.2',
|
||||
],
|
||||
'sensitiveParameter' => [
|
||||
'code' => '<?php
|
||||
@ -277,6 +280,9 @@ class AttributeTest extends TestCase
|
||||
) {}
|
||||
}
|
||||
',
|
||||
'assertions' => [],
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.2',
|
||||
],
|
||||
'createObjectAsAttributeArg' => [
|
||||
'code' => '<?php
|
||||
@ -801,6 +807,8 @@ class AttributeTest extends TestCase
|
||||
}
|
||||
',
|
||||
'error_message' => 'Attribute SensitiveParameter cannot be used on a method',
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.2',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace Psalm\Tests;
|
||||
|
||||
use Psalm\Issue\ConstantDeclarationInTrait;
|
||||
use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait;
|
||||
use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait;
|
||||
|
||||
@ -1233,7 +1232,7 @@ class TraitTest extends TestCase
|
||||
<?php
|
||||
trait A { const B = 0; }
|
||||
PHP,
|
||||
'error_message' => ConstantDeclarationInTrait::getIssueType(),
|
||||
'error_message' => 'ConstantDeclarationInTrait',
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.1',
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user