| @@ 7-25 (lines=19) @@ | ||
| 4 | ||
| 5 | use Prob\Handler\Parameter\Named; |
|
| 6 | ||
| 7 | class ParameterNamed extends ParameterAbstract |
|
| 8 | { |
|
| 9 | private $name; |
|
| 10 | ||
| 11 | public function __construct($name) |
|
| 12 | { |
|
| 13 | $this->name = $name; |
|
| 14 | } |
|
| 15 | ||
| 16 | public function value($value) |
|
| 17 | { |
|
| 18 | return $this->buildValue(new Named($this->name), $value); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function lazy(callable $func) |
|
| 22 | { |
|
| 23 | return $this->buildLazy(new Named($this->name), $func); |
|
| 24 | } |
|
| 25 | } |
|
| @@ 7-25 (lines=19) @@ | ||
| 4 | ||
| 5 | use Prob\Handler\Parameter\Typed; |
|
| 6 | ||
| 7 | class ParameterTyped extends ParameterAbstract |
|
| 8 | { |
|
| 9 | private $type; |
|
| 10 | ||
| 11 | public function __construct($type) |
|
| 12 | { |
|
| 13 | $this->type = $type; |
|
| 14 | } |
|
| 15 | ||
| 16 | public function value($value) |
|
| 17 | { |
|
| 18 | return $this->buildValue(new Typed($this->type), $value); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function lazy(callable $func) |
|
| 22 | { |
|
| 23 | return $this->buildLazy(new Typed($this->type), $func); |
|
| 24 | } |
|
| 25 | } |
|