mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 06:44:04 +00:00
Static analysis
This commit is contained in:
parent
55478c4eb7
commit
7e17b84451
3 changed files with 7 additions and 4 deletions
|
|
@ -12,8 +12,8 @@ parameters:
|
||||||
|
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '#Access to an undefined static property static\(ArchTech\\Enums\\Meta\\MetaProperty\)\:\:\$method#'
|
- '#Access to an undefined static property static\(ArchTech\\Enums\\Meta\\MetaProperty\)\:\:\$method#'
|
||||||
- '#invalid typehint type ArchTech\\Enums\\Metadata#'
|
- '#has invalid type ArchTech\\Enums\\Metadata#'
|
||||||
- '#invalid typehint type Enum#'
|
- '#has invalid type Enum#'
|
||||||
- '#on an unknown class Enum#'
|
- '#on an unknown class Enum#'
|
||||||
# -
|
# -
|
||||||
# message: '#Offset (.*?) does not exist on array\|null#'
|
# message: '#Offset (.*?) does not exist on array\|null#'
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use Attribute;
|
||||||
#[Attribute(Attribute::TARGET_CLASS)]
|
#[Attribute(Attribute::TARGET_CLASS)]
|
||||||
class Meta
|
class Meta
|
||||||
{
|
{
|
||||||
/** @var MetaProperty[] */
|
/** @var string[]|class-string<MetaProperty>[] */
|
||||||
public array $metaProperties;
|
public array $metaProperties;
|
||||||
|
|
||||||
public function __construct(array|string ...$metaProperties)
|
public function __construct(array|string ...$metaProperties)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,10 @@ class Reflection
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($attributes) {
|
if ($attributes) {
|
||||||
return $attributes[0]->newInstance()->metaProperties;
|
/** @var Meta $meta */
|
||||||
|
$meta = $attributes[0]->newInstance();
|
||||||
|
|
||||||
|
return $meta->metaProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue