| Conditions | 1 |
| Paths | 1 |
| Total Lines | 138 |
| Code Lines | 82 |
| 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 |
||
| 110 | public function testToArray() { |
||
| 111 | |||
| 112 | $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\PlotOptions\Columnrange\HighchartsDataLabels(true); |
||
| 113 | |||
| 114 | $obj->setAlign("right"); |
||
| 115 | |||
| 116 | $res1 = ["align" => "right"]; |
||
| 117 | $this->assertEquals($res1, $obj->toArray()); |
||
| 118 | |||
| 119 | $obj->setAllowOverlap(1); |
||
| 120 | |||
| 121 | $res2 = ["align" => "right", "allowOverlap" => 1]; |
||
| 122 | $this->assertEquals($res2, $obj->toArray()); |
||
| 123 | |||
| 124 | $obj->setBackgroundColor("930f2a43179a7ae5fc25ed873223e99f"); |
||
| 125 | |||
| 126 | $res3 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f"]; |
||
| 127 | $this->assertEquals($res3, $obj->toArray()); |
||
| 128 | |||
| 129 | $obj->setBorderColor("97da935a74593c55d78be9d1295aa994"); |
||
| 130 | |||
| 131 | $res4 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994"]; |
||
| 132 | $this->assertEquals($res4, $obj->toArray()); |
||
| 133 | |||
| 134 | $obj->setBorderRadius(8); |
||
| 135 | |||
| 136 | $res5 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8]; |
||
| 137 | $this->assertEquals($res5, $obj->toArray()); |
||
| 138 | |||
| 139 | $obj->setBorderWidth(23); |
||
| 140 | |||
| 141 | $res6 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23]; |
||
| 142 | $this->assertEquals($res6, $obj->toArray()); |
||
| 143 | |||
| 144 | $obj->setClassName("6f66e878c62db60568a3487869695820"); |
||
| 145 | |||
| 146 | $res7 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820"]; |
||
| 147 | $this->assertEquals($res7, $obj->toArray()); |
||
| 148 | |||
| 149 | $obj->setColor("70dda5dfb8053dc6d1c492574bce9bfd"); |
||
| 150 | |||
| 151 | $res8 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd"]; |
||
| 152 | $this->assertEquals($res8, $obj->toArray()); |
||
| 153 | |||
| 154 | $obj->setCrop(0); |
||
| 155 | |||
| 156 | $res9 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0]; |
||
| 157 | $this->assertEquals($res9, $obj->toArray()); |
||
| 158 | |||
| 159 | $obj->setDefer(1); |
||
| 160 | |||
| 161 | $res10 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1]; |
||
| 162 | $this->assertEquals($res10, $obj->toArray()); |
||
| 163 | |||
| 164 | $obj->setEnabled(0); |
||
| 165 | |||
| 166 | $res11 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0]; |
||
| 167 | $this->assertEquals($res11, $obj->toArray()); |
||
| 168 | |||
| 169 | $obj->setFormat("1ddcb92ade31c8fbd370001f9b29a7d9"); |
||
| 170 | |||
| 171 | $res12 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9"]; |
||
| 172 | $this->assertEquals($res12, $obj->toArray()); |
||
| 173 | |||
| 174 | $obj->setFormatter("f2ffc59487832cbad265a8fef2133592"); |
||
| 175 | |||
| 176 | $res13 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592"]; |
||
| 177 | $this->assertEquals($res13, $obj->toArray()); |
||
| 178 | |||
| 179 | $obj->setInside(0); |
||
| 180 | |||
| 181 | $res14 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0]; |
||
| 182 | $this->assertEquals($res14, $obj->toArray()); |
||
| 183 | |||
| 184 | $obj->setOverflow("none"); |
||
| 185 | |||
| 186 | $res15 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none"]; |
||
| 187 | $this->assertEquals($res15, $obj->toArray()); |
||
| 188 | |||
| 189 | $obj->setPadding(62); |
||
| 190 | |||
| 191 | $res16 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62]; |
||
| 192 | $this->assertEquals($res16, $obj->toArray()); |
||
| 193 | |||
| 194 | $obj->setRotation(63); |
||
| 195 | |||
| 196 | $res17 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63]; |
||
| 197 | $this->assertEquals($res17, $obj->toArray()); |
||
| 198 | |||
| 199 | $obj->setShadow(0); |
||
| 200 | |||
| 201 | $res18 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0]; |
||
| 202 | $this->assertEquals($res18, $obj->toArray()); |
||
| 203 | |||
| 204 | $obj->setShape("8c73a98a300905900337f535531dfca6"); |
||
| 205 | |||
| 206 | $res19 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6"]; |
||
| 207 | $this->assertEquals($res19, $obj->toArray()); |
||
| 208 | |||
| 209 | $obj->setStyle(["style" => "a1b01e734b573fca08eb1a65e6df9a38"]); |
||
| 210 | |||
| 211 | $res20 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"]]; |
||
| 212 | $this->assertEquals($res20, $obj->toArray()); |
||
| 213 | |||
| 214 | $obj->setUseHTML(1); |
||
| 215 | |||
| 216 | $res21 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1]; |
||
| 217 | $this->assertEquals($res21, $obj->toArray()); |
||
| 218 | |||
| 219 | $obj->setVerticalAlign("bottom"); |
||
| 220 | |||
| 221 | $res22 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom"]; |
||
| 222 | $this->assertEquals($res22, $obj->toArray()); |
||
| 223 | |||
| 224 | $obj->setXHigh(65); |
||
| 225 | |||
| 226 | $res23 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom", "xHigh" => 65]; |
||
| 227 | $this->assertEquals($res23, $obj->toArray()); |
||
| 228 | |||
| 229 | $obj->setXLow(58); |
||
| 230 | |||
| 231 | $res24 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom", "xHigh" => 65, "xLow" => 58]; |
||
| 232 | $this->assertEquals($res24, $obj->toArray()); |
||
| 233 | |||
| 234 | $obj->setYHigh(15); |
||
| 235 | |||
| 236 | $res25 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom", "xHigh" => 65, "xLow" => 58, "yHigh" => 15]; |
||
| 237 | $this->assertEquals($res25, $obj->toArray()); |
||
| 238 | |||
| 239 | $obj->setYLow(4); |
||
| 240 | |||
| 241 | $res26 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom", "xHigh" => 65, "xLow" => 58, "yHigh" => 15, "yLow" => 4]; |
||
| 242 | $this->assertEquals($res26, $obj->toArray()); |
||
| 243 | |||
| 244 | $obj->setZIndex(37); |
||
| 245 | |||
| 246 | $res27 = ["align" => "right", "allowOverlap" => 1, "backgroundColor" => "930f2a43179a7ae5fc25ed873223e99f", "borderColor" => "97da935a74593c55d78be9d1295aa994", "borderRadius" => 8, "borderWidth" => 23, "className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "crop" => 0, "defer" => 1, "enabled" => 0, "format" => "1ddcb92ade31c8fbd370001f9b29a7d9", "formatter" => "f2ffc59487832cbad265a8fef2133592", "inside" => 0, "overflow" => "none", "padding" => 62, "rotation" => 63, "shadow" => 0, "shape" => "8c73a98a300905900337f535531dfca6", "style" => ["style" => "a1b01e734b573fca08eb1a65e6df9a38"], "useHTML" => 1, "verticalAlign" => "bottom", "xHigh" => 65, "xLow" => 58, "yHigh" => 15, "yLow" => 4, "zIndex" => 37]; |
||
| 247 | $this->assertEquals($res27, $obj->toArray()); |
||
| 248 | } |
||
| 251 |