Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 1977-1995 (lines=19) @@
1974
	 * @param  string $column
1975
	 * @return void
1976
	 */
1977
	public function handleShowColumn($column)
1978
	{
1979
		$columns = $this->getSessionData('_grid_hidden_columns');
1980
1981
		if (!empty($columns)) {
1982
			$pos = array_search($column, $columns);
1983
1984
			if ($pos !== FALSE) {
1985
				unset($columns[$pos]);
1986
			}
1987
		}
1988
1989
		$this->saveSessionData('_grid_hidden_columns', $columns);
1990
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
1991
1992
		$this->redrawControl();
1993
1994
		$this->onRedraw();
1995
	}
1996
1997
1998
	/**
@@ 2003-2022 (lines=20) @@
2000
	 * @param  string $column
2001
	 * @return void
2002
	 */
2003
	public function handleHideColumn($column)
2004
	{
2005
		/**
2006
		 * Store info about hiding a column to session
2007
		 */
2008
		$columns = $this->getSessionData('_grid_hidden_columns');
2009
2010
		if (empty($columns)) {
2011
			$columns = [$column];
2012
		} else if (!in_array($column, $columns)) {
2013
			array_push($columns, $column);
2014
		}
2015
2016
		$this->saveSessionData('_grid_hidden_columns', $columns);
2017
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2018
2019
		$this->redrawControl();
2020
2021
		$this->onRedraw();
2022
	}
2023
2024
2025
	public function handleActionCallback($__key, $__id)