Code Duplication    Length = 7-9 lines in 3 locations

includes/changes/CategoryMembershipChange.php 1 location

@@ 86-92 (lines=7) @@
83
	 *
84
	 * @throws MWException
85
	 */
86
	public function overrideNewForCategorizationCallback( $callback ) {
87
		if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
88
			throw new MWException( 'Cannot override newForCategorization callback in operation.' );
89
		}
90
		Assert::parameterType( 'callable', $callback, '$callback' );
91
		$this->newForCategorizationCallback = $callback;
92
	}
93
94
	/**
95
	 * Determines the number of template links for recursive link updates

includes/WatchedItemStore.php 2 locations

@@ 56-64 (lines=9) @@
53
	 *
54
	 * @throws MWException
55
	 */
56
	public function overrideDeferredUpdatesAddCallableUpdateCallback( $callback ) {
57
		if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
58
			throw new MWException(
59
				'Cannot override DeferredUpdates::addCallableUpdate callback in operation.'
60
			);
61
		}
62
		Assert::parameterType( 'callable', $callback, '$callback' );
63
		$this->deferredUpdatesAddCallableUpdateCallback = $callback;
64
	}
65
66
	/**
67
	 * Overrides the Revision::getTimestampFromId callback
@@ 75-83 (lines=9) @@
72
	 *
73
	 * @throws MWException
74
	 */
75
	public function overrideRevisionGetTimestampFromIdCallback( $callback ) {
76
		if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
77
			throw new MWException(
78
				'Cannot override Revision::getTimestampFromId callback in operation.'
79
			);
80
		}
81
		Assert::parameterType( 'callable', $callback, '$callback' );
82
		$this->revisionGetTimestampFromIdCallback = $callback;
83
	}
84
85
	/**
86
	 * Overrides the default instance of this class