Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

@@ 938-949 (lines=12) @@
935
	 * @return Filter\FilterSelect
936
	 * @throws DataGridException
937
	 */
938
	public function addFilterSelect($key, $name, array $options, $column = NULL)
939
	{
940
		$column = $column ?: $key;
941
942
		if (!is_string($column)) {
943
			throw new DataGridException("Filter Select can only filter through one column.");
944
		}
945
946
		$this->addFilterCheck($key);
947
948
		return $this->filters[$key] = new Filter\FilterSelect($key, $name, $options, $column);
949
	}
950
951
952
	/**
@@ 982-993 (lines=12) @@
979
	 * @return Filter\FilterRange
980
	 * @throws DataGridException
981
	 */
982
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
983
	{
984
		$column = $column ?: $key;
985
986
		if (!is_string($column)) {
987
			throw new DataGridException("FilterRange can only filter through one column.");
988
		}
989
990
		$this->addFilterCheck($key);
991
992
		return $this->filters[$key] = new Filter\FilterRange($key, $name, $column, $name_second);
993
	}
994
995
996
	/**
@@ 1004-1015 (lines=12) @@
1001
	 * @return Filter\FilterDateRange
1002
	 * @throws DataGridException
1003
	 */
1004
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
1005
	{
1006
		$column = $column ?: $key;
1007
1008
		if (!is_string($column)) {
1009
			throw new DataGridException("FilterDateRange can only filter through one column.");
1010
		}
1011
1012
		$this->addFilterCheck($key);
1013
1014
		return $this->filters[$key] = new Filter\FilterDateRange($key, $name, $column, $name_second);
1015
	}
1016
1017
1018
	/**