| 1 | <?php declare(strict_types=1); |
||
| 5 | class Attribute implements AttributeInterface |
||
| 6 | { |
||
| 7 | /** @var string */ |
||
| 8 | private $name; |
||
| 9 | /** @var string|null */ |
||
| 10 | private $default; |
||
| 11 | |||
| 12 | public function __construct(string $name) |
||
| 16 | |||
| 17 | public function getName(): string |
||
| 21 | |||
| 22 | public function getDefault(): ?string |
||
| 26 | |||
| 27 | public function withDefault(string $value): self |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @throws \Midnight\Block\Type\Attribute\Exception\InvalidAttributeValueException |
||
| 36 | */ |
||
| 37 | public function validate(?string $value): void |
||
| 46 | } |
||
| 47 |