Conditions | 5 |
Paths | 16 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
27 | 16 | public function render(Icon $icon) |
|
28 | { |
||
29 | 16 | $jsonBuilder = $this->getJsonBuilder() |
|
30 | 16 | ->setValue('[url]', $icon->getUrl()); |
|
31 | |||
32 | 16 | if ($icon->hasAnchor()) { |
|
33 | 4 | $jsonBuilder->setValue('[anchor]', $icon->getAnchor()->getVariable(), false); |
|
34 | 2 | } |
|
35 | |||
36 | 16 | if ($icon->hasOrigin()) { |
|
37 | 4 | $jsonBuilder->setValue('[origin]', $icon->getOrigin()->getVariable(), false); |
|
38 | 2 | } |
|
39 | |||
40 | 16 | if ($icon->hasScaledSize()) { |
|
41 | 4 | $jsonBuilder->setValue('[scaledSize]', $icon->getScaledSize()->getVariable(), false); |
|
42 | 2 | } |
|
43 | |||
44 | 16 | if ($icon->hasSize()) { |
|
45 | 4 | $jsonBuilder->setValue('[size]', $icon->getScaledSize()->getVariable(), false); |
|
46 | 2 | } |
|
47 | |||
48 | 16 | return $this->getFormatter()->renderObjectAssignment($icon, $jsonBuilder->build()); |
|
49 | } |
||
50 | } |
||
51 |