mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #8427 from staabm/attr
added SensitiveParameter, AllowDynamicProperties php 8.2 attributes
This commit is contained in:
commit
0b790e0982
@ -501,3 +501,15 @@ final class ReturnTypeWillChange
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
#[Attribute]
|
||||
final class SensitiveParameter
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
#[Attribute]
|
||||
final class AllowDynamicProperties
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user