Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1152-1163 (lines=12) @@
1149
	 * @return Filter\FilterSelect
1150
	 * @throws DataGridException
1151
	 */
1152
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1153
	{
1154
		$column = $column ?: $key;
1155
1156
		if (!is_string($column)) {
1157
			throw new DataGridException("Filter Select can only filter in one column.");
1158
		}
1159
1160
		$this->addFilterCheck($key);
1161
1162
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1163
	}
1164
1165
1166
	/**
@@ 1175-1186 (lines=12) @@
1172
	 * @return Filter\FilterSelect
1173
	 * @throws DataGridException
1174
	 */
1175
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1176
	{
1177
		$column = $column ?: $key;
1178
1179
		if (!is_string($column)) {
1180
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1181
		}
1182
1183
		$this->addFilterCheck($key);
1184
1185
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1186
	}
1187
1188
1189
	/**
@@ 1197-1208 (lines=12) @@
1194
	 * @return Filter\FilterDate
1195
	 * @throws DataGridException
1196
	 */
1197
	public function addFilterDate($key, $name, $column = NULL)
1198
	{
1199
		$column = $column ?: $key;
1200
1201
		if (!is_string($column)) {
1202
			throw new DataGridException("FilterDate can only filter in one column.");
1203
		}
1204
1205
		$this->addFilterCheck($key);
1206
1207
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1208
	}
1209
1210
1211
	/**
@@ 1219-1230 (lines=12) @@
1216
	 * @return Filter\FilterRange
1217
	 * @throws DataGridException
1218
	 */
1219
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1220
	{
1221
		$column = $column ?: $key;
1222
1223
		if (!is_string($column)) {
1224
			throw new DataGridException("FilterRange can only filter in one column.");
1225
		}
1226
1227
		$this->addFilterCheck($key);
1228
1229
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1230
	}
1231
1232
1233
	/**
@@ 1241-1252 (lines=12) @@
1238
	 * @return Filter\FilterDateRange
1239
	 * @throws DataGridException
1240
	 */
1241
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1242
	{
1243
		$column = $column ?: $key;
1244
1245
		if (!is_string($column)) {
1246
			throw new DataGridException("FilterDateRange can only filter in one column.");
1247
		}
1248
1249
		$this->addFilterCheck($key);
1250
1251
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1252
	}
1253
1254
1255
	/**