Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

@@ 2083-2101 (lines=19) @@
2080
	 * @param  string $column
2081
	 * @return void
2082
	 */
2083
	public function handleShowColumn($column)
2084
	{
2085
		$columns = $this->getSessionData('_grid_hidden_columns');
2086
2087
		if (!empty($columns)) {
2088
			$pos = array_search($column, $columns);
2089
2090
			if ($pos !== FALSE) {
2091
				unset($columns[$pos]);
2092
			}
2093
		}
2094
2095
		$this->saveSessionData('_grid_hidden_columns', $columns);
2096
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2097
2098
		$this->redrawControl();
2099
2100
		$this->onRedraw();
2101
	}
2102
2103
2104
	/**
@@ 2109-2128 (lines=20) @@
2106
	 * @param  string $column
2107
	 * @return void
2108
	 */
2109
	public function handleHideColumn($column)
2110
	{
2111
		/**
2112
		 * Store info about hiding a column to session
2113
		 */
2114
		$columns = $this->getSessionData('_grid_hidden_columns');
2115
2116
		if (empty($columns)) {
2117
			$columns = [$column];
2118
		} else if (!in_array($column, $columns)) {
2119
			array_push($columns, $column);
2120
		}
2121
2122
		$this->saveSessionData('_grid_hidden_columns', $columns);
2123
		$this->saveSessionData('_grid_hidden_columns_manipulated', TRUE);
2124
2125
		$this->redrawControl();
2126
2127
		$this->onRedraw();
2128
	}
2129
2130
2131
	public function handleActionCallback($__key, $__id)