Code Duplication    Length = 12-16 lines in 2 locations

includes/api/ApiQueryImageInfo.php 2 locations

@@ 118-129 (lines=12) @@
115
				/** @var $img File */
116
				$img = $images[$title];
117
118
				if ( self::getTransformCount() >= self::TRANSFORM_LIMIT ) {
119
					if ( count( $pageIds[NS_FILE] ) == 1 ) {
120
						// See the 'the user is screwed' comment below
121
						$this->setContinueEnumParameter( 'start',
122
							$start !== null ? $start : wfTimestamp( TS_ISO_8601, $img->getTimestamp() )
123
						);
124
					} else {
125
						$this->setContinueEnumParameter( 'continue',
126
							$this->getContinueStr( $img, $start ) );
127
					}
128
					break;
129
				}
130
131
				$fit = $result->addValue(
132
					[ 'query', 'pages', intval( $pageId ) ],
@@ 135-150 (lines=16) @@
132
					[ 'query', 'pages', intval( $pageId ) ],
133
					'imagerepository', $img->getRepoName()
134
				);
135
				if ( !$fit ) {
136
					if ( count( $pageIds[NS_FILE] ) == 1 ) {
137
						// The user is screwed. imageinfo can't be solely
138
						// responsible for exceeding the limit in this case,
139
						// so set a query-continue that just returns the same
140
						// thing again. When the violating queries have been
141
						// out-continued, the result will get through
142
						$this->setContinueEnumParameter( 'start',
143
							$start !== null ? $start : wfTimestamp( TS_ISO_8601, $img->getTimestamp() )
144
						);
145
					} else {
146
						$this->setContinueEnumParameter( 'continue',
147
							$this->getContinueStr( $img, $start ) );
148
					}
149
					break;
150
				}
151
152
				// Check if we can make the requested thumbnail, and get transform parameters.
153
				$finalThumbParams = $this->mergeThumbParams( $img, $scale, $params['urlparam'] );