Code Duplication    Length = 6-6 lines in 4 locations

includes/api/ApiPatrol.php 1 location

@@ 63-68 (lines=6) @@
60
		$tags = $params['tags'];
61
62
		// Check if user can add tags
63
		if ( !is_null( $tags ) ) {
64
			$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $user );
65
			if ( !$ableToTag->isOK() ) {
66
				$this->dieStatus( $ableToTag );
67
			}
68
		}
69
70
		$retval = $rc->doMarkPatrolled( $user, false, $tags );
71

includes/api/ApiProtect.php 1 location

@@ 49-54 (lines=6) @@
46
		$tags = $params['tags'];
47
48
		// Check if user can add tags
49
		if ( !is_null( $tags ) ) {
50
			$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $user );
51
			if ( !$ableToTag->isOK() ) {
52
				$this->dieStatus( $ableToTag );
53
			}
54
		}
55
56
		$expiry = (array)$params['expiry'];
57
		if ( count( $expiry ) != count( $params['protections'] ) ) {

includes/api/ApiUnblock.php 1 location

@@ 67-72 (lines=6) @@
64
		}
65
66
		// Check if user can add tags
67
		if ( !is_null( $params['tags'] ) ) {
68
			$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
69
			if ( !$ableToTag->isOK() ) {
70
				$this->dieStatus( $ableToTag );
71
			}
72
		}
73
74
		$data = [
75
			'Target' => is_null( $params['id'] ) ? $params['user'] : "#{$params['id']}",

includes/api/ApiUndelete.php 1 location

@@ 51-56 (lines=6) @@
48
		}
49
50
		// Check if user can add tags
51
		if ( !is_null( $params['tags'] ) ) {
52
			$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
53
			if ( !$ableToTag->isOK() ) {
54
				$this->dieStatus( $ableToTag );
55
			}
56
		}
57
58
		// Convert timestamps
59
		if ( !isset( $params['timestamps'] ) ) {