Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2628-2646 (lines=19) @@
2625
	 * @param  string $column
2626
	 * @return void
2627
	 */
2628
	public function handleShowColumn($column)
2629
	{
2630
		$columns = $this->getSessionData('_grid_hidden_columns');
2631
2632
		if (!empty($columns)) {
2633
			$pos = array_search($column, $columns, true);
2634
2635
			if ($pos !== false) {
2636
				unset($columns[$pos]);
2637
			}
2638
		}
2639
2640
		$this->saveSessionData('_grid_hidden_columns', $columns);
2641
		$this->saveSessionData('_grid_hidden_columns_manipulated', true);
2642
2643
		$this->redrawControl();
2644
2645
		$this->onRedraw();
2646
	}
2647
2648
2649
	/**
@@ 2654-2673 (lines=20) @@
2651
	 * @param  string $column
2652
	 * @return void
2653
	 */
2654
	public function handleHideColumn($column)
2655
	{
2656
		/**
2657
		 * Store info about hiding a column to session
2658
		 */
2659
		$columns = $this->getSessionData('_grid_hidden_columns');
2660
2661
		if (empty($columns)) {
2662
			$columns = [$column];
2663
		} elseif (!in_array($column, $columns, true)) {
2664
			array_push($columns, $column);
2665
		}
2666
2667
		$this->saveSessionData('_grid_hidden_columns', $columns);
2668
		$this->saveSessionData('_grid_hidden_columns_manipulated', true);
2669
2670
		$this->redrawControl();
2671
2672
		$this->onRedraw();
2673
	}
2674
2675
2676
	public function handleActionCallback($__key, $__id)