Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2433-2451 (lines=19) @@
2430
	 * @param  string $column
2431
	 * @return void
2432
	 */
2433
	public function handleShowColumn($column)
2434
	{
2435
		$columns = $this->getSessionData('_grid_hidden_columns');
2436
2437
		if (!empty($columns)) {
2438
			$pos = array_search($column, $columns);
2439
2440
			if ($pos !== FALSE) {
2441
				unset($columns[$pos]);
2442
			}
2443
		}
2444
2445
		$this->saveSessionData('_grid_hidden_columns', $columns);
2446
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2447
2448
		$this->redrawControl();
2449
2450
		$this->onRedraw();
2451
	}
2452
2453
2454
	/**
@@ 2459-2478 (lines=20) @@
2456
	 * @param  string $column
2457
	 * @return void
2458
	 */
2459
	public function handleHideColumn($column)
2460
	{
2461
		/**
2462
		 * Store info about hiding a column to session
2463
		 */
2464
		$columns = $this->getSessionData('_grid_hidden_columns');
2465
2466
		if (empty($columns)) {
2467
			$columns = [$column];
2468
		} else if (!in_array($column, $columns)) {
2469
			array_push($columns, $column);
2470
		}
2471
2472
		$this->saveSessionData('_grid_hidden_columns', $columns);
2473
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2474
2475
		$this->redrawControl();
2476
2477
		$this->onRedraw();
2478
	}
2479
2480
2481
	public function handleActionCallback($__key, $__id)