Code Duplication    Length = 16-16 lines in 2 locations

includes/api/ApiImageRotate.php 1 location

@@ 34-49 (lines=16) @@
31
	 * @param string $flag The name of the boolean flag to mark this element
32
	 * @param string $name If given, name of the value
33
	 */
34
	private static function addValues( array &$result, $values, $flag = null, $name = null ) {
35
		foreach ( $values as $val ) {
36
			if ( $val instanceof Title ) {
37
				$v = [];
38
				ApiQueryBase::addTitleInfo( $v, $val );
39
			} elseif ( $name !== null ) {
40
				$v = [ $name => $val ];
41
			} else {
42
				$v = $val;
43
			}
44
			if ( $flag !== null ) {
45
				$v[$flag] = true;
46
			}
47
			$result[] = $v;
48
		}
49
	}
50
51
	public function execute() {
52
		$this->useTransactionalTimeLimit();

includes/api/ApiPageSet.php 1 location

@@ 92-107 (lines=16) @@
89
	 * @param string $flag The name of the boolean flag to mark this element
90
	 * @param string $name If given, name of the value
91
	 */
92
	private static function addValues( array &$result, $values, $flag = null, $name = null ) {
93
		foreach ( $values as $val ) {
94
			if ( $val instanceof Title ) {
95
				$v = [];
96
				ApiQueryBase::addTitleInfo( $v, $val );
97
			} elseif ( $name !== null ) {
98
				$v = [ $name => $val ];
99
			} else {
100
				$v = $val;
101
			}
102
			if ( $flag !== null ) {
103
				$v[$flag] = true;
104
			}
105
			$result[] = $v;
106
		}
107
	}
108
109
	/**
110
	 * @param ApiBase $dbSource Module implementing getDB().