Code Duplication    Length = 8-9 lines in 3 locations

includes/jobqueue/jobs/ActivityUpdateJob.php 1 location

@@ 30-38 (lines=9) @@
27
 * @since 1.26
28
 */
29
class ActivityUpdateJob extends Job {
30
	function __construct( Title $title, array $params ) {
31
		parent::__construct( 'activityUpdateJob', $title, $params );
32
33
		if ( !isset( $params['type'] ) ) {
34
			throw new InvalidArgumentException( "Missing 'type' parameter." );
35
		}
36
37
		$this->removeDuplicates = true;
38
	}
39
40
	public function run() {
41
		if ( $this->params['type'] === 'updateWatchlistNotification' ) {

includes/jobqueue/jobs/RecentChangesUpdateJob.php 1 location

@@ 31-39 (lines=9) @@
28
 * @since 1.25
29
 */
30
class RecentChangesUpdateJob extends Job {
31
	function __construct( Title $title, array $params ) {
32
		parent::__construct( 'recentChangesUpdate', $title, $params );
33
34
		if ( !isset( $params['type'] ) ) {
35
			throw new Exception( "Missing 'type' parameter." );
36
		}
37
38
		$this->removeDuplicates = true;
39
	}
40
41
	/**
42
	 * @return RecentChangesUpdateJob

includes/libs/objectcache/HashBagOStuff.php 1 location

@@ 44-51 (lines=8) @@
41
	 * @param array $params Additional parameters include:
42
	 *   - maxKeys : only allow this many keys (using oldest-first eviction)
43
	 */
44
	function __construct( $params = [] ) {
45
		parent::__construct( $params );
46
47
		$this->maxCacheKeys = isset( $params['maxKeys'] ) ? $params['maxKeys'] : INF;
48
		if ( $this->maxCacheKeys <= 0 ) {
49
			throw new InvalidArgumentException( '$maxKeys parameter must be above zero' );
50
		}
51
	}
52
53
	protected function expire( $key ) {
54
		$et = $this->bag[$key][self::KEY_EXP];