Code Duplication    Length = 12-12 lines in 3 locations

src/DataGrid.php 3 locations

@@ 758-769 (lines=12) @@
755
	 * @return Filter\FilterSelect
756
	 * @throws DataGridException
757
	 */
758
	public function addFilterSelect($key, $name, $options, $column = NULL)
759
	{
760
		$column = $column ?: $key;
761
762
		if (!is_string($column)) {
763
			throw new DataGridException("Filter Select can only filter through one column.");
764
		}
765
766
		$this->addFilterCheck($key);
767
768
		return $this->filters[$key] = new Filter\FilterSelect($key, $name, $options, $column);
769
	}
770
771
772
	/**
@@ 802-813 (lines=12) @@
799
	 * @return Filter\FilterRange
800
	 * @throws DataGridException
801
	 */
802
	public function addFilterRange($key, $name, $column = NULL, $name_second = '-')
803
	{
804
		$column = $column ?: $key;
805
806
		if (!is_string($column)) {
807
			throw new DataGridException("FilterRange can only filter through one column.");
808
		}
809
810
		$this->addFilterCheck($key);
811
812
		return $this->filters[$key] = new Filter\FilterRange($key, $name, $column, $name_second);
813
	}
814
815
816
	/**
@@ 824-835 (lines=12) @@
821
	 * @return Filter\FilterDateRange
822
	 * @throws DataGridException
823
	 */
824
	public function addFilterDateRange($key, $name, $column = NULL, $name_second = '-')
825
	{
826
		$column = $column ?: $key;
827
828
		if (!is_string($column)) {
829
			throw new DataGridException("FilterDateRange can only filter through one column.");
830
		}
831
832
		$this->addFilterCheck($key);
833
834
		return $this->filters[$key] = new Filter\FilterDateRange($key, $name, $column, $name_second);
835
	}
836
837
838
	/**