Conditions | 4 |
Paths | 6 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
50 | 3 | public function encode() |
|
51 | { |
||
52 | 3 | $latLon = $this->getLatLng()->encode(); |
|
53 | 3 | $options = $this->getOptions(); |
|
54 | 3 | $name = $this->name; |
|
55 | 3 | $map = $this->map; |
|
56 | 3 | $js = "L.popup($options).setLatLng($latLon).setContent('$this->content')" . ($map !== null ? ".addTo($map);" : ""); |
|
57 | 3 | if (!empty($name)) { |
|
58 | 3 | $js = "var $name = $js" . ($map !== null ? "" : ";"); |
|
59 | 3 | } |
|
60 | |||
61 | 3 | return new JsExpression($js); |
|
62 | } |
||
63 | } |
||
64 |