Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function create(string $variableName, bool $absolute = false, bool $withCurrencyName = true): Mailcode_Commands_Command_ShowPrice |
||
27 | { |
||
28 | $variableName = $this->instantiator->filterVariableName($variableName); |
||
29 | $paramsString = $this->compilePriceParams($absolute, $withCurrencyName); |
||
30 | |||
31 | $cmd = $this->commands->createCommand( |
||
32 | 'ShowPrice', |
||
33 | '', |
||
34 | $variableName . $paramsString, |
||
35 | sprintf( |
||
36 | '{showprice: %s%s}', |
||
37 | $variableName, |
||
38 | $paramsString |
||
39 | ) |
||
40 | ); |
||
41 | |||
42 | $this->instantiator->checkCommand($cmd); |
||
43 | |||
44 | if ($cmd instanceof Mailcode_Commands_Command_ShowPrice) { |
||
45 | return $cmd; |
||
46 | } |
||
47 | |||
48 | throw $this->instantiator->exceptionUnexpectedType('ShowPrice', $cmd); |
||
49 | } |
||
70 |