| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | 9 | public function encode() |
|
| 58 | { |
||
| 59 | 9 | $name = $this->name; |
|
| 60 | 9 | $imageUrl = $this->imageUrl; |
|
| 61 | 9 | $bounds = $this->getImageBounds()->encode(); |
|
| 62 | 9 | $options = $this->getOptions(); |
|
| 63 | 9 | $map = $this->map; |
|
| 64 | 9 | $js = "L.imageOverlay('$imageUrl', $bounds, $options)" . ($map !== null ? ".addTo($map);" : ""); |
|
| 65 | 9 | if (!empty($name)) { |
|
| 66 | 3 | $js = "var $name = $js" . ($map !== null ? "" : ";"); |
|
| 67 | 3 | } |
|
| 68 | |||
| 69 | 9 | return new JsExpression($js); |
|
| 70 | } |
||
| 71 | |||
| 73 |