Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2347-2365 (lines=19) @@
2344
	 * @param  string $column
2345
	 * @return void
2346
	 */
2347
	public function handleShowColumn($column)
2348
	{
2349
		$columns = $this->getSessionData('_grid_hidden_columns');
2350
2351
		if (!empty($columns)) {
2352
			$pos = array_search($column, $columns);
2353
2354
			if ($pos !== FALSE) {
2355
				unset($columns[$pos]);
2356
			}
2357
		}
2358
2359
		$this->saveSessionData('_grid_hidden_columns', $columns);
2360
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2361
2362
		$this->redrawControl();
2363
2364
		$this->onRedraw();
2365
	}
2366
2367
2368
	/**
@@ 2373-2392 (lines=20) @@
2370
	 * @param  string $column
2371
	 * @return void
2372
	 */
2373
	public function handleHideColumn($column)
2374
	{
2375
		/**
2376
		 * Store info about hiding a column to session
2377
		 */
2378
		$columns = $this->getSessionData('_grid_hidden_columns');
2379
2380
		if (empty($columns)) {
2381
			$columns = [$column];
2382
		} else if (!in_array($column, $columns)) {
2383
			array_push($columns, $column);
2384
		}
2385
2386
		$this->saveSessionData('_grid_hidden_columns', $columns);
2387
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2388
2389
		$this->redrawControl();
2390
2391
		$this->onRedraw();
2392
	}
2393
2394
2395
	public function handleActionCallback($__key, $__id)