| Total Complexity | 8 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | trait AttributesBagMethods |
||
| 23 | { |
||
| 24 | |||
| 25 | /** @var array<string, mixed> */ |
||
| 26 | protected array $attributes = []; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritDoc |
||
| 30 | */ |
||
| 31 | public function attributes(): iterable |
||
| 32 | { |
||
| 33 | return $this->attributes; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @inheritDoc |
||
| 38 | */ |
||
| 39 | public function withAttributes(iterable $attributes): static |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritDoc |
||
| 54 | */ |
||
| 55 | public function hasAttribute(string $name): bool |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritDoc |
||
| 62 | */ |
||
| 63 | public function attribute(string $name): mixed |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @inheritDoc |
||
| 74 | */ |
||
| 75 | public function withAttribute(string $name, mixed $value): self |
||
| 81 |