bearsunday /
BEAR.Resource
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace BEAR\Resource; |
||
| 6 | |||
| 7 | use Override; |
||
| 8 | use Ray\Di\InjectorInterface; |
||
| 9 | |||
| 10 | /** @template T */ |
||
| 11 | final readonly class DefaultParam implements ParamInterface |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 12 | { |
||
| 13 | /** @param T $defaultValue */ |
||
| 14 | public function __construct( |
||
| 15 | private mixed $defaultValue, |
||
| 16 | ) { |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritDoc} |
||
| 21 | */ |
||
| 22 | #[Override] |
||
| 23 | public function __invoke(string $varName, array $query, InjectorInterface $injector) |
||
| 24 | { |
||
| 25 | unset($varName, $query, $injector); |
||
| 26 | |||
| 27 | return $this->defaultValue; |
||
| 28 | } |
||
| 29 | } |
||
| 30 |