1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Add support for Override attribute

This commit is contained in:
Antonio del Olmo 2023-12-15 11:14:53 +01:00
parent 64dc2ff747
commit d6cf9faebb
No known key found for this signature in database
GPG Key ID: 2791C5DFABA20C3A
2 changed files with 22 additions and 0 deletions

View File

@ -6,6 +6,12 @@ final class AllowDynamicProperties
public function __construct() {}
}
#[Attribute(Attribute::TARGET_METHOD)]
final class Override
{
public function __construct() {}
}
#[Attribute(Attribute::TARGET_PARAMETER)]
final class SensitiveParameter
{

View File

@ -293,6 +293,22 @@ class AttributeTest extends TestCase
'ignored_issues' => [],
'php_version' => '8.2',
],
'override' => [
'code' => '<?php
namespace OverrideAttribute;
use Override;
class HelloWorld {
#[Override]
public function __invoke() {}
}
',
'assertions' => [],
'ignored_issues' => [],
'php_version' => '8.3',
],
'sensitiveParameter' => [
'code' => '<?php