Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | public function for(string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
||
46 | { |
||
47 | $sourceVariable = '$'.ltrim($sourceVariable, '$'); |
||
48 | $loopVariable = '$'.ltrim($loopVariable, '$'); |
||
49 | |||
50 | $cmd = Mailcode::create()->getCommands()->createCommand( |
||
51 | 'For', |
||
52 | '', |
||
53 | sprintf( |
||
54 | '%s in: %s', |
||
55 | $loopVariable, |
||
56 | $sourceVariable |
||
57 | ), |
||
58 | sprintf( |
||
59 | '{for: %s in: %s}', |
||
60 | $loopVariable, |
||
61 | $sourceVariable |
||
62 | ) |
||
63 | ); |
||
64 | |||
65 | $this->instantiator->checkCommand($cmd); |
||
66 | |||
67 | if($cmd instanceof Mailcode_Commands_Command_For) |
||
68 | { |
||
69 | return $cmd; |
||
70 | } |
||
71 | |||
72 | throw $this->instantiator->exceptionUnexpectedType('For', $cmd); |
||
73 | } |
||
75 |