Code Duplication    Length = 19-20 lines in 2 locations

src/DataGrid.php 2 locations

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