Code Duplication    Length = 4-6 lines in 2 locations

includes/WebRequest.php 1 location

@@ 439-444 (lines=6) @@
436
	 * @return mixed Old value if one was present, null otherwise
437
	 */
438
	public function unsetVal( $key ) {
439
		if ( !isset( $this->data[$key] ) ) {
440
			$ret = null;
441
		} else {
442
			$ret = $this->data[$key];
443
			unset( $this->data[$key] );
444
		}
445
		return $ret;
446
	}
447

maintenance/convertExtensionToRegistration.php 1 location

@@ 142-145 (lines=4) @@
139
		// Move some keys to the top
140
		$out = [];
141
		foreach ( $this->promote as $key ) {
142
			if ( isset( $this->json[$key] ) ) {
143
				$out[$key] = $this->json[$key];
144
				unset( $this->json[$key] );
145
			}
146
		}
147
		$out += $this->json;
148
		// Put this at the bottom