2020-10-24 06:10:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Psalm\Storage;
|
|
|
|
|
|
|
|
use Psalm\CodeLocation;
|
|
|
|
use Psalm\Internal\Scanner\UnresolvedConstantComponent;
|
2021-06-08 04:55:21 +02:00
|
|
|
use Psalm\Type\Union;
|
2020-10-24 06:10:22 +02:00
|
|
|
|
2022-11-04 19:04:23 +01:00
|
|
|
/**
|
|
|
|
* @psalm-immutable
|
|
|
|
*/
|
2022-02-06 22:09:03 +01:00
|
|
|
final class AttributeArg
|
2020-10-24 06:10:22 +02:00
|
|
|
{
|
2022-11-04 19:04:23 +01:00
|
|
|
use ImmutableNonCloneableTrait;
|
2020-10-24 06:10:22 +02:00
|
|
|
/**
|
|
|
|
* @var ?string
|
2022-02-18 06:15:58 +01:00
|
|
|
* @psalm-suppress PossiblyUnusedProperty It's part of the public API for now
|
2020-10-24 06:10:22 +02:00
|
|
|
*/
|
|
|
|
public $name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Union|UnresolvedConstantComponent
|
|
|
|
*/
|
|
|
|
public $type;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var CodeLocation
|
2022-02-18 06:15:58 +01:00
|
|
|
* @psalm-suppress PossiblyUnusedProperty It's part of the public API for now
|
2020-10-24 06:10:22 +02:00
|
|
|
*/
|
|
|
|
public $location;
|
|
|
|
|
|
|
|
/**
|
2022-02-18 06:15:58 +01:00
|
|
|
* @param Union|UnresolvedConstantComponent $type
|
2020-10-24 06:10:22 +02:00
|
|
|
*/
|
|
|
|
public function __construct(
|
|
|
|
?string $name,
|
|
|
|
$type,
|
|
|
|
CodeLocation $location
|
|
|
|
) {
|
|
|
|
$this->name = $name;
|
|
|
|
$this->type = $type;
|
|
|
|
$this->location = $location;
|
|
|
|
}
|
|
|
|
}
|