Code Duplication    Length = 8-9 lines in 2 locations

includes/jobqueue/JobQueueGroup.php 1 location

@@ 71-78 (lines=8) @@
68
	 * @param bool|string $wiki Wiki ID
69
	 * @return JobQueueGroup
70
	 */
71
	public static function singleton( $wiki = false ) {
72
		$wiki = ( $wiki === false ) ? wfWikiID() : $wiki;
73
		if ( !isset( self::$instances[$wiki] ) ) {
74
			self::$instances[$wiki] = new self( $wiki, wfConfiguredReadOnlyReason() );
75
		}
76
77
		return self::$instances[$wiki];
78
	}
79
80
	/**
81
	 * Destroy the singleton instances

includes/filebackend/lockmanager/LockManagerGroup.php 1 location

@@ 53-61 (lines=9) @@
50
	 * @param bool|string $domain Domain (usually wiki ID). Default: false.
51
	 * @return LockManagerGroup
52
	 */
53
	public static function singleton( $domain = false ) {
54
		$domain = ( $domain === false ) ? wfWikiID() : $domain;
55
		if ( !isset( self::$instances[$domain] ) ) {
56
			self::$instances[$domain] = new self( $domain );
57
			self::$instances[$domain]->initFromGlobals();
58
		}
59
60
		return self::$instances[$domain];
61
	}
62
63
	/**
64
	 * Destroy the singleton instances