| Conditions | 4 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 9 | public function encode() |
|
| 29 | { |
||
| 30 | 9 | $this->clientOptions['position'] = $this->position; |
|
| 31 | 9 | $options = $this->getOptions(); |
|
| 32 | 9 | $name = $this->getName(); |
|
| 33 | 9 | $map = $this->map; |
|
| 34 | 9 | $js = "L.control.zoom($options)" . ($map !== null ? ".addTo($map);" : ""); |
|
| 35 | 9 | if (!empty($name)) { |
|
| 36 | 3 | $js = "var $name = $js" . ($map !== null ? "" : ";"); |
|
| 37 | 3 | } |
|
| 38 | 9 | return new JsExpression($js); |
|
| 39 | } |
||
| 40 | |||
| 42 |