Skip to content

Commit

Permalink
Merge pull request #8427 from staabm/attr
Browse files Browse the repository at this point in the history
added SensitiveParameter, AllowDynamicProperties php 8.2 attributes
  • Loading branch information
orklah authored Aug 22, 2022
2 parents 9170572 + 72a1c05 commit 0b790e0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stubs/CoreGenericClasses.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,15 @@ final class ReturnTypeWillChange
{
public function __construct() {}
}

#[Attribute]
final class SensitiveParameter
{
public function __construct() {}
}

#[Attribute]
final class AllowDynamicProperties
{
public function __construct() {}
}
26 changes: 26 additions & 0 deletions tests/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,32 @@ public function getIterator()
[],
'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]
Expand Down

0 comments on commit 0b790e0

Please sign in to comment.