| Conditions | 1 |
| Paths | 1 |
| Total Lines | 128 |
| Code Lines | 76 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 106 | public function testToArray() { |
||
| 107 | |||
| 108 | $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Bubble\HighchartsDataLabels(true); |
||
| 109 | |||
| 110 | $obj->setAlign("right"); |
||
| 111 | |||
| 112 | $res1 = ["align" => "right"]; |
||
| 113 | $this->assertEquals($res1, $obj->toArray()); |
||
| 114 | |||
| 115 | $obj->setAllowOverlap(0); |
||
| 116 | |||
| 117 | $res2 = ["align" => "right", "allowOverlap" => 0]; |
||
| 118 | $this->assertEquals($res2, $obj->toArray()); |
||
| 119 | |||
| 120 | $obj->setBackgroundColor("930f2a43179a7ae5fc25ed873223e99f"); |
||
| 121 | |||
| 122 | $res3 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f"]; |
||
| 123 | $this->assertEquals($res3, $obj->toArray()); |
||
| 124 | |||
| 125 | $obj->setBorderColor("97da935a74593c55d78be9d1295aa994"); |
||
| 126 | |||
| 127 | $res4 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994"]; |
||
| 128 | $this->assertEquals($res4, $obj->toArray()); |
||
| 129 | |||
| 130 | $obj->setBorderRadius(67); |
||
| 131 | |||
| 132 | $res5 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67]; |
||
| 133 | $this->assertEquals($res5, $obj->toArray()); |
||
| 134 | |||
| 135 | $obj->setBorderWidth(80); |
||
| 136 | |||
| 137 | $res6 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80]; |
||
| 138 | $this->assertEquals($res6, $obj->toArray()); |
||
| 139 | |||
| 140 | $obj->setClassName("6f66e878c62db60568a3487869695820"); |
||
| 141 | |||
| 142 | $res7 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820"]; |
||
| 143 | $this->assertEquals($res7, $obj->toArray()); |
||
| 144 | |||
| 145 | $obj->setColor("70dda5dfb8053dc6d1c492574bce9bfd"); |
||
| 146 | |||
| 147 | $res8 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd"]; |
||
| 148 | $this->assertEquals($res8, $obj->toArray()); |
||
| 149 | |||
| 150 | $obj->setCrop(0); |
||
| 151 | |||
| 152 | $res9 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0]; |
||
| 153 | $this->assertEquals($res9, $obj->toArray()); |
||
| 154 | |||
| 155 | $obj->setDefer(0); |
||
| 156 | |||
| 157 | $res10 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0]; |
||
| 158 | $this->assertEquals($res10, $obj->toArray()); |
||
| 159 | |||
| 160 | $obj->setEnabled(0); |
||
| 161 | |||
| 162 | $res11 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0]; |
||
| 163 | $this->assertEquals($res11, $obj->toArray()); |
||
| 164 | |||
| 165 | $obj->setFormat("1ddcb92ade31c8fbd370001f9b29a7d9"); |
||
| 166 | |||
| 167 | $res12 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9"]; |
||
| 168 | $this->assertEquals($res12, $obj->toArray()); |
||
| 169 | |||
| 170 | $obj->setFormatter("f2ffc59487832cbad265a8fef2133592"); |
||
| 171 | |||
| 172 | $res13 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592"]; |
||
| 173 | $this->assertEquals($res13, $obj->toArray()); |
||
| 174 | |||
| 175 | $obj->setInside(0); |
||
| 176 | |||
| 177 | $res14 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0]; |
||
| 178 | $this->assertEquals($res14, $obj->toArray()); |
||
| 179 | |||
| 180 | $obj->setOverflow("none"); |
||
| 181 | |||
| 182 | $res15 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none"]; |
||
| 183 | $this->assertEquals($res15, $obj->toArray()); |
||
| 184 | |||
| 185 | $obj->setPadding(72); |
||
| 186 | |||
| 187 | $res16 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72]; |
||
| 188 | $this->assertEquals($res16, $obj->toArray()); |
||
| 189 | |||
| 190 | $obj->setRotation(42); |
||
| 191 | |||
| 192 | $res17 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42]; |
||
| 193 | $this->assertEquals($res17, $obj->toArray()); |
||
| 194 | |||
| 195 | $obj->setShadow(1); |
||
| 196 | |||
| 197 | $res18 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1]; |
||
| 198 | $this->assertEquals($res18, $obj->toArray()); |
||
| 199 | |||
| 200 | $obj->setShape("8c73a98a300905900337f535531dfca6"); |
||
| 201 | |||
| 202 | $res19 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6"]; |
||
| 203 | $this->assertEquals($res19, $obj->toArray()); |
||
| 204 | |||
| 205 | $obj->setStyle(["style" => "a1b01e734b573fca08eb1a65e6df9a38"]); |
||
| 206 | |||
| 207 | $res20 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"]]; |
||
| 208 | $this->assertEquals($res20, $obj->toArray()); |
||
| 209 | |||
| 210 | $obj->setUseHTML(0); |
||
| 211 | |||
| 212 | $res21 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 0]; |
||
| 213 | $this->assertEquals($res21, $obj->toArray()); |
||
| 214 | |||
| 215 | $obj->setVerticalAlign("bottom"); |
||
| 216 | |||
| 217 | $res22 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 0, "verticalAlign" => "bottom"]; |
||
| 218 | $this->assertEquals($res22, $obj->toArray()); |
||
| 219 | |||
| 220 | $obj->setX(59); |
||
| 221 | |||
| 222 | $res23 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 0, "verticalAlign" => "bottom", "x" => 59]; |
||
| 223 | $this->assertEquals($res23, $obj->toArray()); |
||
| 224 | |||
| 225 | $obj->setY(83); |
||
| 226 | |||
| 227 | $res24 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 0, "verticalAlign" => "bottom", "x" => 59, "y" => 83]; |
||
| 228 | $this->assertEquals($res24, $obj->toArray()); |
||
| 229 | |||
| 230 | $obj->setZIndex(34); |
||
| 231 | |||
| 232 | $res25 = ["align" => "right", "allowOverlap" => 0, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 67, "borderWidth" => 80, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 0, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 72, "rotation" => 42, "shadow" => 1, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 0, "verticalAlign" => "bottom", "x" => 59, "y" => 83, "zIndex" => 34]; |
||
| 233 | $this->assertEquals($res25, $obj->toArray()); |
||
| 234 | } |
||
| 237 |