Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1746-1764 (lines=19) @@
1743
	 * @param  string $column
1744
	 * @return void
1745
	 */
1746
	public function handleShowColumn($column)
1747
	{
1748
		$columns = $this->getSessionData('_grid_hidden_columns');
1749
1750
		if (!empty($columns)) {
1751
			$pos = array_search($column, $columns);
1752
1753
			if ($pos !== FALSE) {
1754
				unset($columns[$pos]);
1755
			}
1756
		}
1757
1758
		$this->saveSessionData('_grid_hidden_columns', $columns);
1759
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1760
1761
		$this->redrawControl();
1762
1763
		$this->onRedraw();
1764
	}
1765
1766
1767
	/**
@@ 1772-1791 (lines=20) @@
1769
	 * @param  string $column
1770
	 * @return void
1771
	 */
1772
	public function handleHideColumn($column)
1773
	{
1774
		/**
1775
		 * Store info about hiding a column to session
1776
		 */
1777
		$columns = $this->getSessionData('_grid_hidden_columns');
1778
1779
		if (empty($columns)) {
1780
			$columns = [$column];
1781
		} else if (!in_array($column, $columns)) {
1782
			array_push($columns, $column);
1783
		}
1784
1785
		$this->saveSessionData('_grid_hidden_columns', $columns);
1786
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1787
1788
		$this->redrawControl();
1789
1790
		$this->onRedraw();
1791
	}
1792
1793
1794
	public function handleActionCallback($__key, $__id)