Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1046-1057 (lines=12) @@
1043
	 * @return Filter\FilterSelect
1044
	 * @throws DataGridException
1045
	 */
1046
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1047
	{
1048
		$column = $column ?: $key;
1049
1050
		if (!is_string($column)) {
1051
			throw new DataGridException("Filter Select can only filter in one column.");
1052
		}
1053
1054
		$this->addFilterCheck($key);
1055
1056
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1057
	}
1058
1059
1060
	/**
@@ 1069-1080 (lines=12) @@
1066
	 * @return Filter\FilterSelect
1067
	 * @throws DataGridException
1068
	 */
1069
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1070
	{
1071
		$column = $column ?: $key;
1072
1073
		if (!is_string($column)) {
1074
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1075
		}
1076
1077
		$this->addFilterCheck($key);
1078
1079
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1080
	}
1081
1082
1083
	/**
@@ 1091-1102 (lines=12) @@
1088
	 * @return Filter\FilterDate
1089
	 * @throws DataGridException
1090
	 */
1091
	public function addFilterDate($key, $name, $column = NULL)
1092
	{
1093
		$column = $column ?: $key;
1094
1095
		if (!is_string($column)) {
1096
			throw new DataGridException("FilterDate can only filter in one column.");
1097
		}
1098
1099
		$this->addFilterCheck($key);
1100
1101
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1102
	}
1103
1104
1105
	/**
@@ 1113-1124 (lines=12) @@
1110
	 * @return Filter\FilterRange
1111
	 * @throws DataGridException
1112
	 */
1113
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1114
	{
1115
		$column = $column ?: $key;
1116
1117
		if (!is_string($column)) {
1118
			throw new DataGridException("FilterRange can only filter in one column.");
1119
		}
1120
1121
		$this->addFilterCheck($key);
1122
1123
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1124
	}
1125
1126
1127
	/**
@@ 1135-1146 (lines=12) @@
1132
	 * @return Filter\FilterDateRange
1133
	 * @throws DataGridException
1134
	 */
1135
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1136
	{
1137
		$column = $column ?: $key;
1138
1139
		if (!is_string($column)) {
1140
			throw new DataGridException("FilterDateRange can only filter in one column.");
1141
		}
1142
1143
		$this->addFilterCheck($key);
1144
1145
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1146
	}
1147
1148
1149
	/**