Code Duplication    Length = 7-7 lines in 2 locations

includes/api/ApiQueryBlocks.php 1 location

@@ 152-158 (lines=7) @@
149
			$show = array_flip( $params['show'] );
150
151
			/* Check for conflicting parameters. */
152
			if ( ( isset( $show['account'] ) && isset( $show['!account'] ) )
153
				|| ( isset( $show['ip'] ) && isset( $show['!ip'] ) )
154
				|| ( isset( $show['range'] ) && isset( $show['!range'] ) )
155
				|| ( isset( $show['temp'] ) && isset( $show['!temp'] ) )
156
			) {
157
				$this->dieUsageMsg( 'show' );
158
			}
159
160
			$this->addWhereIf( 'ipb_user = 0', isset( $show['!account'] ) );
161
			$this->addWhereIf( 'ipb_user != 0', isset( $show['account'] ) );

includes/api/ApiQueryUserContributions.php 1 location

@@ 252-258 (lines=7) @@
249
		if ( !is_null( $show ) ) {
250
			$show = array_flip( $show );
251
252
			if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
253
				|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
254
				|| ( isset( $show['top'] ) && isset( $show['!top'] ) )
255
				|| ( isset( $show['new'] ) && isset( $show['!new'] ) )
256
			) {
257
				$this->dieUsageMsg( 'show' );
258
			}
259
260
			$this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
261
			$this->addWhereIf( 'rev_minor_edit != 0', isset( $show['minor'] ) );