| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | final class InputParam implements ParamInterface |
||
| 13 | { |
||
| 14 | private readonly string $type; |
||
| 15 | private readonly bool $isDefaultAvailable; |
||
| 16 | private readonly mixed $defaultValue; |
||
| 17 | private readonly InputParamFactory $factory; |
||
| 18 | |||
| 19 | public function __construct( |
||
| 20 | ReflectionNamedType $type, |
||
| 21 | private readonly ReflectionParameter $parameter, |
||
| 22 | ) { |
||
| 23 | $this->type = $type->getName(); |
||
|
|
|||
| 24 | $this->isDefaultAvailable = $parameter->isDefaultValueAvailable(); |
||
| 25 | $this->defaultValue = $this->isDefaultAvailable ? $parameter->getDefaultValue() : null; |
||
| 26 | $this->factory = new InputParamFactory( |
||
| 27 | new InputParamEnumHandler(), |
||
| 28 | new InputParamObjectHandler(), |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritDoc} |
||
| 34 | */ |
||
| 35 | |||
| 36 | /** @param array<string, mixed> $query */ |
||
| 37 | public function __invoke(string $varName, array $query, InjectorInterface $injector): mixed |
||
| 47 | ); |
||
| 48 | } |
||
| 50 |