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

Merge pull request #8427 from staabm/attr

added SensitiveParameter, AllowDynamicProperties php 8.2 attributes
This commit is contained in:
orklah 2022-08-22 19:15:07 +02:00 committed by GitHub
commit 0b790e0982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -501,3 +501,15 @@ final class ReturnTypeWillChange
{
public function __construct() {}
}
#[Attribute]
final class SensitiveParameter
{
public function __construct() {}
}
#[Attribute]
final class AllowDynamicProperties
{
public function __construct() {}
}

View File

@ -249,6 +249,32 @@ class AttributeTest extends TestCase
[],
'8.1'
],
'allowDynamicProperties' => [
'<?php
namespace AllowDynamicPropertiesAttribute;
use AllowDynamicProperties;
#[AllowDynamicProperties]
class Foo
{}
',
],
'sensitiveParameter' => [
'<?php
namespace SensitiveParameter;
use SensitiveParameter;
class HelloWorld {
public function __construct(
#[SensitiveParameter] string $password
) {}
}
',
],
'createObjectAsAttributeArg' => [
'<?php
#[Attribute]