Code Duplication    Length = 13-13 lines in 2 locations

lib/private/OCS/Result.php 1 location

@@ 138-150 (lines=13) @@
135
	 * @param string $value The value, null will delete it
136
	 * @return $this
137
	 */
138
	public function addHeader($name, $value) {
139
		$name = trim($name);  // always remove leading and trailing whitespace
140
		// to be able to reliably check for security
141
		// headers
142
143
		if(is_null($value)) {
144
			unset($this->headers[$name]);
145
		} else {
146
			$this->headers[$name] = $value;
147
		}
148
149
		return $this;
150
	}
151
152
	/**
153
	 * Returns the set headers

lib/public/AppFramework/Http/Response.php 1 location

@@ 176-188 (lines=13) @@
173
	 * @return $this
174
	 * @since 6.0.0 - return value was added in 7.0.0
175
	 */
176
	public function addHeader($name, $value) {
177
		$name = trim($name);  // always remove leading and trailing whitespace
178
		                      // to be able to reliably check for security
179
		                      // headers
180
181
		if(is_null($value)) {
182
			unset($this->headers[$name]);
183
		} else {
184
			$this->headers[$name] = $value;
185
		}
186
187
		return $this;
188
	}
189
190
191
	/**