| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Annotation; |
| 6: | |
| 7: | use LaravelUi5\OData\Edm\Contracts\Annotation\AnnotationValueInterface; |
| 8: | use LaravelUi5\OData\Edm\Contracts\Annotation\CollectionAnnotationValueInterface; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | final readonly class CollectionAnnotationValue implements CollectionAnnotationValueInterface |
| 20: | { |
| 21: | |
| 22: | private array $items; |
| 23: | |
| 24: | public function __construct(AnnotationValueInterface ...$items) |
| 25: | { |
| 26: | $this->items = array_values($items); |
| 27: | } |
| 28: | |
| 29: | |
| 30: | public function getItems(): array |
| 31: | { |
| 32: | return $this->items; |
| 33: | } |
| 34: | |
| 35: | public function isEmpty(): bool |
| 36: | { |
| 37: | return $this->items === []; |
| 38: | } |
| 39: | |
| 40: | public function count(): int |
| 41: | { |
| 42: | return count($this->items); |
| 43: | } |
| 44: | } |
| 45: | |