| Conditions | 1 |
| Paths | 1 |
| Total Lines | 103 |
| Code Lines | 61 |
| 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 |
||
| 96 | public function testToArray() { |
||
| 97 | |||
| 98 | $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData(true); |
||
| 99 | |||
| 100 | $obj->setColumns(["columns" => "54ca84a794888fe8d92834787dfa935a"]); |
||
| 101 | |||
| 102 | $res1 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"]]; |
||
| 103 | $this->assertEquals($res1, $obj->toArray()); |
||
| 104 | |||
| 105 | $obj->setComplete("d9a22d7a8178d5b42a8750123cbfe5b1"); |
||
| 106 | |||
| 107 | $res2 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1"]; |
||
| 108 | $this->assertEquals($res2, $obj->toArray()); |
||
| 109 | |||
| 110 | $obj->setCsv("628cb5675ff524f3e719b7aa2e88fe3f"); |
||
| 111 | |||
| 112 | $res3 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f"]; |
||
| 113 | $this->assertEquals($res3, $obj->toArray()); |
||
| 114 | |||
| 115 | $obj->setDateFormat("mm/dd/YY"); |
||
| 116 | |||
| 117 | $res4 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY"]; |
||
| 118 | $this->assertEquals($res4, $obj->toArray()); |
||
| 119 | |||
| 120 | $obj->setDecimalPoint("7d9af7a21241609a979bda8ca517044c"); |
||
| 121 | |||
| 122 | $res5 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c"]; |
||
| 123 | $this->assertEquals($res5, $obj->toArray()); |
||
| 124 | |||
| 125 | $obj->setEndColumn(30); |
||
| 126 | |||
| 127 | $res6 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30]; |
||
| 128 | $this->assertEquals($res6, $obj->toArray()); |
||
| 129 | |||
| 130 | $obj->setEndRow(89); |
||
| 131 | |||
| 132 | $res7 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89]; |
||
| 133 | $this->assertEquals($res7, $obj->toArray()); |
||
| 134 | |||
| 135 | $obj->setFirstRowAsNames(1); |
||
| 136 | |||
| 137 | $res8 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1]; |
||
| 138 | $this->assertEquals($res8, $obj->toArray()); |
||
| 139 | |||
| 140 | $obj->setGoogleSpreadsheetKey("4c42edbd1e3a85f2857f1e3a5cf3fb59"); |
||
| 141 | |||
| 142 | $res9 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59"]; |
||
| 143 | $this->assertEquals($res9, $obj->toArray()); |
||
| 144 | |||
| 145 | $obj->setGoogleSpreadsheetWorksheet("b1444e571854190993273e8b1f53b89c"); |
||
| 146 | |||
| 147 | $res10 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c"]; |
||
| 148 | $this->assertEquals($res10, $obj->toArray()); |
||
| 149 | |||
| 150 | $obj->setItemDelimiter("2b9ff3bde6b855958954383dc46b1d4f"); |
||
| 151 | |||
| 152 | $res11 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f"]; |
||
| 153 | $this->assertEquals($res11, $obj->toArray()); |
||
| 154 | |||
| 155 | $obj->setLineDelimiter("28e3cbbd23484ddd36f72aa7110ee056"); |
||
| 156 | |||
| 157 | $res12 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056"]; |
||
| 158 | $this->assertEquals($res12, $obj->toArray()); |
||
| 159 | |||
| 160 | $obj->setParseDate("8b186f0402c084188de6f80e91f77984"); |
||
| 161 | |||
| 162 | $res13 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984"]; |
||
| 163 | $this->assertEquals($res13, $obj->toArray()); |
||
| 164 | |||
| 165 | $obj->setParsed("c3732cbf21875cb12763787c984dd68d"); |
||
| 166 | |||
| 167 | $res14 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d"]; |
||
| 168 | $this->assertEquals($res14, $obj->toArray()); |
||
| 169 | |||
| 170 | $obj->setRows(["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"]); |
||
| 171 | |||
| 172 | $res15 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"]]; |
||
| 173 | $this->assertEquals($res15, $obj->toArray()); |
||
| 174 | |||
| 175 | $obj->setSeriesMapping(["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"]); |
||
| 176 | |||
| 177 | $res16 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"], "seriesMapping" => ["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"]]; |
||
| 178 | $this->assertEquals($res16, $obj->toArray()); |
||
| 179 | |||
| 180 | $obj->setStartColumn(35); |
||
| 181 | |||
| 182 | $res17 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"], "seriesMapping" => ["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"], "startColumn" => 35]; |
||
| 183 | $this->assertEquals($res17, $obj->toArray()); |
||
| 184 | |||
| 185 | $obj->setStartRow(31); |
||
| 186 | |||
| 187 | $res18 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"], "seriesMapping" => ["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"], "startColumn" => 35, "startRow" => 31]; |
||
| 188 | $this->assertEquals($res18, $obj->toArray()); |
||
| 189 | |||
| 190 | $obj->setSwitchRowsAndColumns(1); |
||
| 191 | |||
| 192 | $res19 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"], "seriesMapping" => ["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"], "startColumn" => 35, "startRow" => 31, "switchRowsAndColumns" => 1]; |
||
| 193 | $this->assertEquals($res19, $obj->toArray()); |
||
| 194 | |||
| 195 | $obj->setTable("aab9e1de16f38176f86d7a92ba337a8d"); |
||
| 196 | |||
| 197 | $res20 = ["columns" => ["columns" => "54ca84a794888fe8d92834787dfa935a"], "complete" => "d9a22d7a8178d5b42a8750123cbfe5b1", "csv" => "628cb5675ff524f3e719b7aa2e88fe3f", "dateFormat" => "mm/dd/YY", "decimalPoint" => "7d9af7a21241609a979bda8ca517044c", "endColumn" => 30, "endRow" => 89, "firstRowAsNames" => 1, "googleSpreadsheetKey" => "4c42edbd1e3a85f2857f1e3a5cf3fb59", "googleSpreadsheetWorksheet" => "b1444e571854190993273e8b1f53b89c", "itemDelimiter" => "2b9ff3bde6b855958954383dc46b1d4f", "lineDelimiter" => "28e3cbbd23484ddd36f72aa7110ee056", "parseDate" => "8b186f0402c084188de6f80e91f77984", "parsed" => "c3732cbf21875cb12763787c984dd68d", "rows" => ["rows" => "df347a373b8f92aa0ae3dd920a5ec2f6"], "seriesMapping" => ["seriesMapping" => "2112d1fa8b6001694eb605edccdf0810"], "startColumn" => 35, "startRow" => 31, "switchRowsAndColumns" => 1, "table" => "aab9e1de16f38176f86d7a92ba337a8d"]; |
||
| 198 | $this->assertEquals($res20, $obj->toArray()); |
||
| 199 | } |
||
| 202 |