Code Duplication    Length = 12-12 lines in 5 locations

src/DataGrid.php 5 locations

@@ 1053-1064 (lines=12) @@
1050
	 * @return Filter\FilterSelect
1051
	 * @throws DataGridException
1052
	 */
1053
	public function addFilterSelect($key, $name, array $options, $column = NULL)
1054
	{
1055
		$column = $column ?: $key;
1056
1057
		if (!is_string($column)) {
1058
			throw new DataGridException("Filter Select can only filter in one column.");
1059
		}
1060
1061
		$this->addFilterCheck($key);
1062
1063
		return $this->filters[$key] = new Filter\FilterSelect($this, $key, $name, $options, $column);
1064
	}
1065
1066
1067
	/**
@@ 1076-1087 (lines=12) @@
1073
	 * @return Filter\FilterSelect
1074
	 * @throws DataGridException
1075
	 */
1076
	public function addFilterMultiSelect($key, $name, array $options, $column = NULL)
1077
	{
1078
		$column = $column ?: $key;
1079
1080
		if (!is_string($column)) {
1081
			throw new DataGridException("Filter MultiSelect can only filter in one column.");
1082
		}
1083
1084
		$this->addFilterCheck($key);
1085
1086
		return $this->filters[$key] = new Filter\FilterMultiSelect($this, $key, $name, $options, $column);
1087
	}
1088
1089
1090
	/**
@@ 1098-1109 (lines=12) @@
1095
	 * @return Filter\FilterDate
1096
	 * @throws DataGridException
1097
	 */
1098
	public function addFilterDate($key, $name, $column = NULL)
1099
	{
1100
		$column = $column ?: $key;
1101
1102
		if (!is_string($column)) {
1103
			throw new DataGridException("FilterDate can only filter in one column.");
1104
		}
1105
1106
		$this->addFilterCheck($key);
1107
1108
		return $this->filters[$key] = new Filter\FilterDate($this, $key, $name, $column);
1109
	}
1110
1111
1112
	/**
@@ 1120-1131 (lines=12) @@
1117
	 * @return Filter\FilterRange
1118
	 * @throws DataGridException
1119
	 */
1120
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
1121
	{
1122
		$column = $column ?: $key;
1123
1124
		if (!is_string($column)) {
1125
			throw new DataGridException("FilterRange can only filter in one column.");
1126
		}
1127
1128
		$this->addFilterCheck($key);
1129
1130
		return $this->filters[$key] = new Filter\FilterRange($this, $key, $name, $column, $name_second);
1131
	}
1132
1133
1134
	/**
@@ 1142-1153 (lines=12) @@
1139
	 * @return Filter\FilterDateRange
1140
	 * @throws DataGridException
1141
	 */
1142
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1143
	{
1144
		$column = $column ?: $key;
1145
1146
		if (!is_string($column)) {
1147
			throw new DataGridException("FilterDateRange can only filter in one column.");
1148
		}
1149
1150
		$this->addFilterCheck($key);
1151
1152
		return $this->filters[$key] = new Filter\FilterDateRange($this, $key, $name, $column, $name_second);
1153
	}
1154
1155
1156
	/**