Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1194-1205 (lines=12) @@
1191
	 * @return Filter\FilterSelect
1192
	 * @throws DataGridException
1193
	 */
1194
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1195
	{
1196
		$column = $column ?: $key;
1197
1198
		if (!is_string($column)) {
1199
			throw new DataGridException("Filter Select can only filter in one column.");
1200
		}
1201
1202
		$this->addFilterCheck($key);
1203
1204
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1205
	}
1206
1207
1208
	/**
@@ 1217-1228 (lines=12) @@
1214
	 * @return Filter\FilterSelect
1215
	 * @throws DataGridException
1216
	 */
1217
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1218
	{
1219
		$column = $column ?: $key;
1220
1221
		if (!is_string($column)) {
1222
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1223
		}
1224
1225
		$this->addFilterCheck($key);
1226
1227
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1228
	}
1229
1230
1231
	/**
@@ 1239-1250 (lines=12) @@
1236
	 * @return Filter\FilterDate
1237
	 * @throws DataGridException
1238
	 */
1239
	public function addFilterDate($key, $name, $column = NULL)
1240
	{
1241
		$column = $column ?: $key;
1242
1243
		if (!is_string($column)) {
1244
			throw new DataGridException("FilterDate can only filter in one column.");
1245
		}
1246
1247
		$this->addFilterCheck($key);
1248
1249
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1250
	}
1251
1252
1253
	/**
@@ 1261-1272 (lines=12) @@
1258
	 * @return Filter\FilterRange
1259
	 * @throws DataGridException
1260
	 */
1261
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1262
	{
1263
		$column = $column ?: $key;
1264
1265
		if (!is_string($column)) {
1266
			throw new DataGridException("FilterRange can only filter in one column.");
1267
		}
1268
1269
		$this->addFilterCheck($key);
1270
1271
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1272
	}
1273
1274
1275
	/**
@@ 1283-1294 (lines=12) @@
1280
	 * @return Filter\FilterDateRange
1281
	 * @throws DataGridException
1282
	 */
1283
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1284
	{
1285
		$column = $column ?: $key;
1286
1287
		if (!is_string($column)) {
1288
			throw new DataGridException("FilterDateRange can only filter in one column.");
1289
		}
1290
1291
		$this->addFilterCheck($key);
1292
1293
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1294
	}
1295
1296
1297
	/**