Code Duplication    Length = 4-5 lines in 6 locations

includes/libs/MultiHttpClient.php 2 locations

@@ 150-153 (lines=4) @@
147
				'body'     => '',
148
				'error'    => ''
149
			];
150
			if ( isset( $req[0] ) ) {
151
				$req['method'] = $req[0]; // short-form
152
				unset( $req[0] );
153
			}
154
			if ( isset( $req[1] ) ) {
155
				$req['url'] = $req[1]; // short-form
156
				unset( $req[1] );
@@ 154-157 (lines=4) @@
151
				$req['method'] = $req[0]; // short-form
152
				unset( $req[0] );
153
			}
154
			if ( isset( $req[1] ) ) {
155
				$req['url'] = $req[1]; // short-form
156
				unset( $req[1] );
157
			}
158
			if ( !isset( $req['method'] ) ) {
159
				throw new Exception( "Request has no 'method' field set." );
160
			} elseif ( !isset( $req['url'] ) ) {

includes/libs/virtualrest/VirtualRESTServiceClient.php 2 locations

@@ 160-163 (lines=4) @@
157
	 */
158
	public function runMulti( array $reqs ) {
159
		foreach ( $reqs as $index => &$req ) {
160
			if ( isset( $req[0] ) ) {
161
				$req['method'] = $req[0]; // short-form
162
				unset( $req[0] );
163
			}
164
			if ( isset( $req[1] ) ) {
165
				$req['url'] = $req[1]; // short-form
166
				unset( $req[1] );
@@ 164-167 (lines=4) @@
161
				$req['method'] = $req[0]; // short-form
162
				unset( $req[0] );
163
			}
164
			if ( isset( $req[1] ) ) {
165
				$req['url'] = $req[1]; // short-form
166
				unset( $req[1] );
167
			}
168
			$req['chain'] = []; // chain or list of replaced requests
169
		}
170
		unset( $req ); // don't assign over this by accident

includes/GlobalFunctions.php 1 location

@@ 832-835 (lines=4) @@
829
		$bits['delimiter'] = ':';
830
		// parse_url detects for news: and mailto: the host part of an url as path
831
		// We have to correct this wrong detection
832
		if ( isset( $bits['path'] ) ) {
833
			$bits['host'] = $bits['path'];
834
			$bits['path'] = '';
835
		}
836
	} else {
837
		return false;
838
	}

includes/filebackend/FSFile.php 1 location

@@ 204-208 (lines=5) @@
201
		# NOTE: $gis[2] contains a code for the image type. This is no longer used.
202
		$info['width'] = $gis[0];
203
		$info['height'] = $gis[1];
204
		if ( isset( $gis['bits'] ) ) {
205
			$info['bits'] = $gis['bits'];
206
		} else {
207
			$info['bits'] = 0;
208
		}
209
210
		return $info;
211
	}