Conditions | 4 |
Paths | 6 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
40 | 9 | public function encode() |
|
41 | { |
||
42 | 9 | $bounds = $this->getLatLng()->toArray(true); |
|
43 | 9 | $radius = $this->radius; |
|
44 | 9 | $options = $this->getOptions(); |
|
45 | 9 | $name = $this->name; |
|
46 | 9 | $map = $this->map; |
|
47 | 9 | $js = $this->bindPopupContent("L.circle($bounds, $radius, $options)") . ($map !== null ? ".addTo($map);" : ""); |
|
48 | 9 | if (!empty($name)) { |
|
49 | 3 | $js = "var $name = $js" . ($map !== null ? "" : ";"); |
|
50 | 3 | } |
|
51 | 9 | return new JsExpression($js); |
|
52 | } |
||
53 | |||
55 |