Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

@@ 854-865 (lines=12) @@
851
	 * @return Filter\FilterSelect
852
	 * @throws DataGridException
853
	 */
854
	public function addFilterSelect($key, $name, $options, $column = NULL)
855
	{
856
		$column = $column ?: $key;
857
858
		if (!is_string($column)) {
859
			throw new DataGridException("Filter Select can only filter through one column.");
860
		}
861
862
		$this->addFilterCheck($key);
863
864
		return $this->filters[$key] = new Filter\FilterSelect($key, $name, $options, $column);
865
	}
866
867
868
	/**
@@ 898-909 (lines=12) @@
895
	 * @return Filter\FilterRange
896
	 * @throws DataGridException
897
	 */
898
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
899
	{
900
		$column = $column ?: $key;
901
902
		if (!is_string($column)) {
903
			throw new DataGridException("FilterRange can only filter through one column.");
904
		}
905
906
		$this->addFilterCheck($key);
907
908
		return $this->filters[$key] = new Filter\FilterRange($key, $name, $column, $name_second);
909
	}
910
911
912
	/**
@@ 920-931 (lines=12) @@
917
	 * @return Filter\FilterDateRange
918
	 * @throws DataGridException
919
	 */
920
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
921
	{
922
		$column = $column ?: $key;
923
924
		if (!is_string($column)) {
925
			throw new DataGridException("FilterDateRange can only filter through one column.");
926
		}
927
928
		$this->addFilterCheck($key);
929
930
		return $this->filters[$key] = new Filter\FilterDateRange($key, $name, $column, $name_second);
931
	}
932
933
934
	/**