Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1100-1111 (lines=12) @@
1097
	 * @return Filter\FilterSelect
1098
	 * @throws DataGridException
1099
	 */
1100
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1101
	{
1102
		$column = $column ?: $key;
1103
1104
		if (!is_string($column)) {
1105
			throw new DataGridException("Filter Select can only filter in one column.");
1106
		}
1107
1108
		$this->addFilterCheck($key);
1109
1110
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1111
	}
1112
1113
1114
	/**
@@ 1123-1134 (lines=12) @@
1120
	 * @return Filter\FilterSelect
1121
	 * @throws DataGridException
1122
	 */
1123
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1124
	{
1125
		$column = $column ?: $key;
1126
1127
		if (!is_string($column)) {
1128
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1129
		}
1130
1131
		$this->addFilterCheck($key);
1132
1133
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1134
	}
1135
1136
1137
	/**
@@ 1145-1156 (lines=12) @@
1142
	 * @return Filter\FilterDate
1143
	 * @throws DataGridException
1144
	 */
1145
	public function addFilterDate($key, $name, $column = NULL)
1146
	{
1147
		$column = $column ?: $key;
1148
1149
		if (!is_string($column)) {
1150
			throw new DataGridException("FilterDate can only filter in one column.");
1151
		}
1152
1153
		$this->addFilterCheck($key);
1154
1155
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1156
	}
1157
1158
1159
	/**
@@ 1167-1178 (lines=12) @@
1164
	 * @return Filter\FilterRange
1165
	 * @throws DataGridException
1166
	 */
1167
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1168
	{
1169
		$column = $column ?: $key;
1170
1171
		if (!is_string($column)) {
1172
			throw new DataGridException("FilterRange can only filter in one column.");
1173
		}
1174
1175
		$this->addFilterCheck($key);
1176
1177
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1178
	}
1179
1180
1181
	/**
@@ 1189-1200 (lines=12) @@
1186
	 * @return Filter\FilterDateRange
1187
	 * @throws DataGridException
1188
	 */
1189
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1190
	{
1191
		$column = $column ?: $key;
1192
1193
		if (!is_string($column)) {
1194
			throw new DataGridException("FilterDateRange can only filter in one column.");
1195
		}
1196
1197
		$this->addFilterCheck($key);
1198
1199
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1200
	}
1201
1202
1203
	/**