Code Duplication    Length = 3-3 lines in 4 locations

includes/api/ApiQueryDeletedRevisions.php 1 location

@@ 66-68 (lines=3) @@
63
64
		$db = $this->getDB();
65
66
		if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
67
			$this->dieUsage( 'user and excludeuser cannot be used together', 'badparams' );
68
		}
69
70
		$this->addTables( 'archive' );
71
		if ( $resultPageSet === null ) {

includes/api/ApiQueryDeletedrevs.php 1 location

@@ 119-121 (lines=3) @@
116
			}
117
		}
118
119
		if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
120
			$this->dieUsage( 'user and excludeuser cannot be used together', 'badparams' );
121
		}
122
123
		$this->addTables( 'archive' );
124
		$this->addFields( [ 'ar_title', 'ar_namespace', 'ar_timestamp', 'ar_deleted', 'ar_id' ] );

includes/api/ApiQueryRecentChanges.php 1 location

@@ 243-245 (lines=3) @@
240
			);
241
		}
242
243
		if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
244
			$this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
245
		}
246
247
		if ( !is_null( $params['user'] ) ) {
248
			$this->addWhereFld( 'rc_user_text', $params['user'] );

includes/api/ApiQueryWatchlist.php 1 location

@@ 210-212 (lines=3) @@
207
			}
208
		}
209
210
		if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
211
			$this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
212
		}
213
		if ( !is_null( $params['user'] ) ) {
214
			$this->addWhereFld( 'rc_user_text', $params['user'] );
215
		}