Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2320-2338 (lines=19) @@
2317
	 * @param  string $column
2318
	 * @return void
2319
	 */
2320
	public function handleShowColumn($column)
2321
	{
2322
		$columns = $this->getSessionData('_grid_hidden_columns');
2323
2324
		if (!empty($columns)) {
2325
			$pos = array_search($column, $columns);
2326
2327
			if ($pos !== FALSE) {
2328
				unset($columns[$pos]);
2329
			}
2330
		}
2331
2332
		$this->saveSessionData('_grid_hidden_columns', $columns);
2333
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2334
2335
		$this->redrawControl();
2336
2337
		$this->onRedraw();
2338
	}
2339
2340
2341
	/**
@@ 2346-2365 (lines=20) @@
2343
	 * @param  string $column
2344
	 * @return void
2345
	 */
2346
	public function handleHideColumn($column)
2347
	{
2348
		/**
2349
		 * Store info about hiding a column to session
2350
		 */
2351
		$columns = $this->getSessionData('_grid_hidden_columns');
2352
2353
		if (empty($columns)) {
2354
			$columns = [$column];
2355
		} else if (!in_array($column, $columns)) {
2356
			array_push($columns, $column);
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
	public function handleActionCallback($__key, $__id)