Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | abstract class Parameter |
||
14 | { |
||
15 | final public static function union(self ...$parameters): self |
||
16 | { |
||
17 | return new UnionParameter(...$parameters); |
||
18 | } |
||
19 | |||
20 | final public static function typed(string $type, $value): self |
||
21 | { |
||
22 | return new TypedParameter($type, $value); |
||
23 | } |
||
24 | |||
25 | final public static function untyped($value): self |
||
28 | } |
||
29 | |||
30 | final public static function factory(callable $factory): ValueFactory |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return mixed |
||
37 | * |
||
38 | * @throws UnresolveableArgument |
||
39 | */ |
||
40 | final public function resolve(\ReflectionParameter $parameter) |
||
45 | } |
||
46 | |||
47 | abstract public function type(): string; |
||
48 | |||
49 | abstract protected function valueFor(\ReflectionParameter $refParameter); |
||
50 | } |
||
51 |