1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm;
6:
7: use LaravelUi5\OData\Edm\Contracts\Annotation\AnnotationInterface;
8: use LaravelUi5\OData\Edm\Contracts\FunctionParameterInterface;
9: use LaravelUi5\OData\Edm\Contracts\Type\TypeFacetsInterface;
10: use LaravelUi5\OData\Edm\Contracts\Type\TypeInterface;
11:
12: final readonly class FunctionParameter implements FunctionParameterInterface
13: {
14: use HasAnnotations;
15:
16: /**
17: * @param list<AnnotationInterface> $annotations
18: */
19: public function __construct(
20: private string $name,
21: private TypeInterface $type,
22: private bool $isCollection = false,
23: private bool $isNullable = true,
24: private ?TypeFacetsInterface $facets = null,
25: array $annotations = [],
26: ) {
27: $this->annotations = $annotations;
28: }
29:
30: public function getName(): string
31: {
32: return $this->name;
33: }
34:
35: public function getType(): TypeInterface
36: {
37: return $this->type;
38: }
39:
40: public function isCollection(): bool
41: {
42: return $this->isCollection;
43: }
44:
45: public function isNullable(): bool
46: {
47: return $this->isNullable;
48: }
49:
50: public function getFacets(): ?TypeFacetsInterface
51: {
52: return $this->facets;
53: }
54: }
55: