Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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