Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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