1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Type;
6:
7: use LaravelUi5\OData\Edm\EdmPrimitiveType;
8: use LaravelUi5\OData\Edm\Contracts\Type\PrimitiveTypeInterface;
9:
10: /**
11: * Wraps a EdmPrimitiveType case as a first-class TypeInterface participant.
12: *
13: * The name and qualified name are derived directly from the enum value, e.g.
14: * EdmPrimitiveType::String → name "String", qualified name "Edm.String".
15: */
16: final readonly class PrimitiveType implements PrimitiveTypeInterface
17: {
18: public function __construct(
19: private EdmPrimitiveType $primitiveType,
20: ) {}
21:
22: public function getPrimitiveType(): EdmPrimitiveType
23: {
24: return $this->primitiveType;
25: }
26:
27: public function getName(): string
28: {
29: return $this->primitiveType->name;
30: }
31:
32: public function getQualifiedName(): string
33: {
34: return $this->primitiveType->value;
35: }
36: }
37: