Code Duplication    Length = 7-7 lines in 2 locations

includes/api/ApiQueryRecentChanges.php 1 location

@@ 178-184 (lines=7) @@
175
176
		$this->addWhereFld( 'rc_namespace', $params['namespace'] );
177
178
		if ( !is_null( $params['type'] ) ) {
179
			try {
180
				$this->addWhereFld( 'rc_type', RecentChange::parseToRCType( $params['type'] ) );
181
			} catch ( Exception $e ) {
182
				ApiBase::dieDebug( __METHOD__, $e->getMessage() );
183
			}
184
		}
185
186
		if ( !is_null( $params['show'] ) ) {
187
			$show = array_flip( $params['show'] );

includes/api/ApiQueryWatchlist.php 1 location

@@ 155-161 (lines=7) @@
152
			$options['filters'] = array_keys( $show );
153
		}
154
155
		if ( !is_null( $params['type'] ) ) {
156
			try {
157
				$options['rcTypes'] = RecentChange::parseToRCType( $params['type'] );
158
			} catch ( Exception $e ) {
159
				ApiBase::dieDebug( __METHOD__, $e->getMessage() );
160
			}
161
		}
162
163
		if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
164
			$this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );