Code Duplication    Length = 18-19 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1695-1712 (lines=18) @@
1692
	 * @param  string $column
1693
	 * @return void
1694
	 */
1695
	public function handleShowColumn($column)
1696
	{
1697
		$columns = $this->getSessionData('_grid_hidden_columns');
1698
1699
		if (!empty($columns)) {
1700
			$pos = array_search($column, $columns);
1701
1702
			if ($pos !== FALSE) {
1703
				unset($columns[$pos]);
1704
			}
1705
		}
1706
1707
		$this->saveSessionData('_grid_hidden_columns', $columns);
1708
1709
		$this->redrawControl();
1710
1711
		$this->onRedraw();
1712
	}
1713
1714
1715
	/**
@@ 1720-1738 (lines=19) @@
1717
	 * @param  string $column
1718
	 * @return void
1719
	 */
1720
	public function handleHideColumn($column)
1721
	{
1722
		/**
1723
		 * Store info about hiding a column to session
1724
		 */
1725
		$columns = $this->getSessionData('_grid_hidden_columns');
1726
1727
		if (empty($columns)) {
1728
			$columns = [$column];
1729
		} else if (!in_array($column, $columns)) {
1730
			array_push($columns, $column);
1731
		}
1732
1733
		$this->saveSessionData('_grid_hidden_columns', $columns);
1734
1735
		$this->redrawControl();
1736
1737
		$this->onRedraw();
1738
	}
1739
1740
1741
	public function handleActionCallback($__key, $__id)