Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1110-1121 (lines=12) @@
1107
	 * @return Filter\FilterSelect
1108
	 * @throws DataGridException
1109
	 */
1110
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1111
	{
1112
		$column = $column ?: $key;
1113
1114
		if (!is_string($column)) {
1115
			throw new DataGridException("Filter Select can only filter in one column.");
1116
		}
1117
1118
		$this->addFilterCheck($key);
1119
1120
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1121
	}
1122
1123
1124
	/**
@@ 1133-1144 (lines=12) @@
1130
	 * @return Filter\FilterSelect
1131
	 * @throws DataGridException
1132
	 */
1133
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1134
	{
1135
		$column = $column ?: $key;
1136
1137
		if (!is_string($column)) {
1138
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1139
		}
1140
1141
		$this->addFilterCheck($key);
1142
1143
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1144
	}
1145
1146
1147
	/**
@@ 1155-1166 (lines=12) @@
1152
	 * @return Filter\FilterDate
1153
	 * @throws DataGridException
1154
	 */
1155
	public function addFilterDate($key, $name, $column = NULL)
1156
	{
1157
		$column = $column ?: $key;
1158
1159
		if (!is_string($column)) {
1160
			throw new DataGridException("FilterDate can only filter in one column.");
1161
		}
1162
1163
		$this->addFilterCheck($key);
1164
1165
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1166
	}
1167
1168
1169
	/**
@@ 1177-1188 (lines=12) @@
1174
	 * @return Filter\FilterRange
1175
	 * @throws DataGridException
1176
	 */
1177
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1178
	{
1179
		$column = $column ?: $key;
1180
1181
		if (!is_string($column)) {
1182
			throw new DataGridException("FilterRange can only filter in one column.");
1183
		}
1184
1185
		$this->addFilterCheck($key);
1186
1187
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1188
	}
1189
1190
1191
	/**
@@ 1199-1210 (lines=12) @@
1196
	 * @return Filter\FilterDateRange
1197
	 * @throws DataGridException
1198
	 */
1199
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1200
	{
1201
		$column = $column ?: $key;
1202
1203
		if (!is_string($column)) {
1204
			throw new DataGridException("FilterDateRange can only filter in one column.");
1205
		}
1206
1207
		$this->addFilterCheck($key);
1208
1209
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1210
	}
1211
1212
1213
	/**