Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

@@ 931-942 (lines=12) @@
928
	 * @return Filter\FilterSelect
929
	 * @throws DataGridException
930
	 */
931
	public function addFilterSelect($key, $name, array $options, $column = NULL)
932
	{
933
		$column = $column ?: $key;
934
935
		if (!is_string($column)) {
936
			throw new DataGridException("Filter Select can only filter through one column.");
937
		}
938
939
		$this->addFilterCheck($key);
940
941
		return $this->filters[$key] = new Filter\FilterSelect($key, $name, $options, $column);
942
	}
943
944
945
	/**
@@ 975-986 (lines=12) @@
972
	 * @return Filter\FilterRange
973
	 * @throws DataGridException
974
	 */
975
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
976
	{
977
		$column = $column ?: $key;
978
979
		if (!is_string($column)) {
980
			throw new DataGridException("FilterRange can only filter through one column.");
981
		}
982
983
		$this->addFilterCheck($key);
984
985
		return $this->filters[$key] = new Filter\FilterRange($key, $name, $column, $name_second);
986
	}
987
988
989
	/**
@@ 997-1008 (lines=12) @@
994
	 * @return Filter\FilterDateRange
995
	 * @throws DataGridException
996
	 */
997
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
998
	{
999
		$column = $column ?: $key;
1000
1001
		if (!is_string($column)) {
1002
			throw new DataGridException("FilterDateRange can only filter through one column.");
1003
		}
1004
1005
		$this->addFilterCheck($key);
1006
1007
		return $this->filters[$key] = new Filter\FilterDateRange($key, $name, $column, $name_second);
1008
	}
1009
1010
1011
	/**