Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2383-2401 (lines=19) @@
2380
	 * @param  string $column
2381
	 * @return void
2382
	 */
2383
	public function handleShowColumn($column)
2384
	{
2385
		$columns = $this->getSessionData('_grid_hidden_columns');
2386
2387
		if (!empty($columns)) {
2388
			$pos = array_search($column, $columns);
2389
2390
			if ($pos !== FALSE) {
2391
				unset($columns[$pos]);
2392
			}
2393
		}
2394
2395
		$this->saveSessionData('_grid_hidden_columns', $columns);
2396
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2397
2398
		$this->redrawControl();
2399
2400
		$this->onRedraw();
2401
	}
2402
2403
2404
	/**
@@ 2409-2428 (lines=20) @@
2406
	 * @param  string $column
2407
	 * @return void
2408
	 */
2409
	public function handleHideColumn($column)
2410
	{
2411
		/**
2412
		 * Store info about hiding a column to session
2413
		 */
2414
		$columns = $this->getSessionData('_grid_hidden_columns');
2415
2416
		if (empty($columns)) {
2417
			$columns = [$column];
2418
		} else if (!in_array($column, $columns)) {
2419
			array_push($columns, $column);
2420
		}
2421
2422
		$this->saveSessionData('_grid_hidden_columns', $columns);
2423
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2424
2425
		$this->redrawControl();
2426
2427
		$this->onRedraw();
2428
	}
2429
2430
2431
	public function handleActionCallback($__key, $__id)