Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

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