Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2095-2113 (lines=19) @@
2092
	 * @param  string $column
2093
	 * @return void
2094
	 */
2095
	public function handleShowColumn($column)
2096
	{
2097
		$columns = $this->getSessionData('_grid_hidden_columns');
2098
2099
		if (!empty($columns)) {
2100
			$pos = array_search($column, $columns);
2101
2102
			if ($pos !== FALSE) {
2103
				unset($columns[$pos]);
2104
			}
2105
		}
2106
2107
		$this->saveSessionData('_grid_hidden_columns', $columns);
2108
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2109
2110
		$this->redrawControl();
2111
2112
		$this->onRedraw();
2113
	}
2114
2115
2116
	/**
@@ 2121-2140 (lines=20) @@
2118
	 * @param  string $column
2119
	 * @return void
2120
	 */
2121
	public function handleHideColumn($column)
2122
	{
2123
		/**
2124
		 * Store info about hiding a column to session
2125
		 */
2126
		$columns = $this->getSessionData('_grid_hidden_columns');
2127
2128
		if (empty($columns)) {
2129
			$columns = [$column];
2130
		} else if (!in_array($column, $columns)) {
2131
			array_push($columns, $column);
2132
		}
2133
2134
		$this->saveSessionData('_grid_hidden_columns', $columns);
2135
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2136
2137
		$this->redrawControl();
2138
2139
		$this->onRedraw();
2140
	}
2141
2142
2143
	public function handleActionCallback($__key, $__id)