Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

@@ 975-986 (lines=12) @@
972
	 * @return Filter\FilterSelect
973
	 * @throws DataGridException
974
	 */
975
	public function addFilterSelect($key, $name, array $options, $column = NULL)
976
	{
977
		$column = $column ?: $key;
978
979
		if (!is_string($column)) {
980
			throw new DataGridException("Filter Select can only filter in one column.");
981
		}
982
983
		$this->addFilterCheck($key);
984
985
		return $this->filters[$key] = new Filter\FilterSelect($key, $name, $options, $column);
986
	}
987
988
989
	/**
@@ 1042-1053 (lines=12) @@
1039
	 * @return Filter\FilterRange
1040
	 * @throws DataGridException
1041
	 */
1042
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1043
	{
1044
		$column = $column ?: $key;
1045
1046
		if (!is_string($column)) {
1047
			throw new DataGridException("FilterRange can only filter in one column.");
1048
		}
1049
1050
		$this->addFilterCheck($key);
1051
1052
		return $this->filters[$key] = new Filter\FilterRange($key, $name, $column, $name_second);
1053
	}
1054
1055
1056
	/**
@@ 1064-1075 (lines=12) @@
1061
	 * @return Filter\FilterDateRange
1062
	 * @throws DataGridException
1063
	 */
1064
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1065
	{
1066
		$column = $column ?: $key;
1067
1068
		if (!is_string($column)) {
1069
			throw new DataGridException("FilterDateRange can only filter in one column.");
1070
		}
1071
1072
		$this->addFilterCheck($key);
1073
1074
		return $this->filters[$key] = new Filter\FilterDateRange($key, $name, $column, $name_second);
1075
	}
1076
1077
1078
	/**