Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2131-2149 (lines=19) @@
2128
	 * @param  string $column
2129
	 * @return void
2130
	 */
2131
	public function handleShowColumn($column)
2132
	{
2133
		$columns = $this->getSessionData('_grid_hidden_columns');
2134
2135
		if (!empty($columns)) {
2136
			$pos = array_search($column, $columns);
2137
2138
			if ($pos !== FALSE) {
2139
				unset($columns[$pos]);
2140
			}
2141
		}
2142
2143
		$this->saveSessionData('_grid_hidden_columns', $columns);
2144
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2145
2146
		$this->redrawControl();
2147
2148
		$this->onRedraw();
2149
	}
2150
2151
2152
	/**
@@ 2157-2176 (lines=20) @@
2154
	 * @param  string $column
2155
	 * @return void
2156
	 */
2157
	public function handleHideColumn($column)
2158
	{
2159
		/**
2160
		 * Store info about hiding a column to session
2161
		 */
2162
		$columns = $this->getSessionData('_grid_hidden_columns');
2163
2164
		if (empty($columns)) {
2165
			$columns = [$column];
2166
		} else if (!in_array($column, $columns)) {
2167
			array_push($columns, $column);
2168
		}
2169
2170
		$this->saveSessionData('_grid_hidden_columns', $columns);
2171
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2172
2173
		$this->redrawControl();
2174
2175
		$this->onRedraw();
2176
	}
2177
2178
2179
	public function handleActionCallback($__key, $__id)