Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | final class Call implements InstructsHowToMap |
||
20 | { |
||
21 | private $function; |
||
22 | private $constraint; |
||
23 | |||
24 | private function __construct(Closure $function, ?Satisfiable $constraint) |
||
25 | { |
||
26 | $this->function = $function; |
||
27 | $this->constraint = $constraint; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Creates a closure-call instruction for the property. |
||
32 | * |
||
33 | * @param Closure $function The anonymous function to call while hydrating |
||
34 | * this property. |
||
35 | * @return Call The instruction object. |
||
36 | */ |
||
37 | public static function the(Closure $function): Call |
||
38 | { |
||
39 | return new Call($function, null); |
||
40 | } |
||
41 | |||
42 | /** @inheritdoc */ |
||
43 | public function that(Satisfiable $constraint): InstructsHowToMap |
||
46 | } |
||
47 | |||
48 | /** @inheritdoc */ |
||
49 | public function followFor(string $property): MapsProperty |
||
58 |