Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2036-2054 (lines=19) @@
2033
	 * @param  string $column
2034
	 * @return void
2035
	 */
2036
	public function handleShowColumn($column)
2037
	{
2038
		$columns = $this->getSessionData('_grid_hidden_columns');
2039
2040
		if (!empty($columns)) {
2041
			$pos = array_search($column, $columns);
2042
2043
			if ($pos !== FALSE) {
2044
				unset($columns[$pos]);
2045
			}
2046
		}
2047
2048
		$this->saveSessionData('_grid_hidden_columns', $columns);
2049
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2050
2051
		$this->redrawControl();
2052
2053
		$this->onRedraw();
2054
	}
2055
2056
2057
	/**
@@ 2062-2081 (lines=20) @@
2059
	 * @param  string $column
2060
	 * @return void
2061
	 */
2062
	public function handleHideColumn($column)
2063
	{
2064
		/**
2065
		 * Store info about hiding a column to session
2066
		 */
2067
		$columns = $this->getSessionData('_grid_hidden_columns');
2068
2069
		if (empty($columns)) {
2070
			$columns = [$column];
2071
		} else if (!in_array($column, $columns)) {
2072
			array_push($columns, $column);
2073
		}
2074
2075
		$this->saveSessionData('_grid_hidden_columns', $columns);
2076
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2077
2078
		$this->redrawControl();
2079
2080
		$this->onRedraw();
2081
	}
2082
2083
2084
	public function handleActionCallback($__key, $__id)