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

Add a stub file for Attributes defined by PHP

This commit is contained in:
robchett 2023-06-17 10:03:08 +01:00
parent eb64a471c4
commit 5fc48bbb62
3 changed files with 15 additions and 12 deletions

View File

@ -2236,6 +2236,8 @@ class Config
];
if ($codebase->analysis_php_version_id >= 8_00_00) {
$stringable_path = $dir_lvl_2 . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'CoreGenericAttributes.phpstub';
$this->internal_stubs[] = $stringable_path;
$stringable_path = $dir_lvl_2 . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'Php80.phpstub';
$this->internal_stubs[] = $stringable_path;
}

View File

@ -0,0 +1,13 @@
<?php
#[Attribute(Attribute::TARGET_CLASS)]
final class AllowDynamicProperties
{
public function __construct() {}
}
#[Attribute(Attribute::TARGET_PARAMETER)]
final class SensitiveParameter
{
public function __construct() {}
}

View File

@ -34,18 +34,6 @@ namespace {
public function getIterator(): Iterator {}
}
#[Attribute(Attribute::TARGET_PARAMETER)]
final class SensitiveParameter
{
public function __construct() {}
}
#[Attribute(Attribute::TARGET_CLASS)]
final class AllowDynamicProperties
{
public function __construct() {}
}
/**
* @psalm-pure
* @param positive-int $length