Fix issues identified by SpaceBeforeSingleLineComment sniff
[lhc/web/wiklou.git] / includes / api / ApiQueryDuplicateFiles.php
index 010f8d5..1038a9f 100644 (file)
@@ -107,7 +107,7 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                // iterate over $images to handle continue param correct
                foreach ( $images as $image => $pageId ) {
                        if ( !isset( $sha1s[$image] ) ) {
-                               continue; //file does not exist
+                               continue; // file does not exist
                        }
                        $sha1 = $sha1s[$image];
                        $dupFiles = $filesBySha1s[$sha1];
@@ -118,14 +118,14 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                        foreach ( $dupFiles as $dupFile ) {
                                $dupName = $dupFile->getName();
                                if ( $image == $dupName && $dupFile->isLocal() ) {
-                                       continue; //ignore the local file itself
+                                       continue; // ignore the local file itself
                                }
                                if ( $skipUntilThisDup !== false && $dupName < $skipUntilThisDup ) {
-                                       continue; //skip to pos after the image from continue param
+                                       continue; // skip to pos after the image from continue param
                                }
                                $skipUntilThisDup = false;
                                if ( ++$count > $params['limit'] ) {
-                                       $fit = false; //break outer loop
+                                       $fit = false; // break outer loop
                                        // We're one over limit which shows that
                                        // there are additional images to be had. Stop here...
                                        $this->setContinueEnumParameter( 'continue', $image . '|' . $dupName );
@@ -137,11 +137,9 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                                        $r = array(
                                                'name' => $dupName,
                                                'user' => $dupFile->getUser( 'text' ),
-                                               'timestamp' => wfTimestamp( TS_ISO_8601, $dupFile->getTimestamp() )
+                                               'timestamp' => wfTimestamp( TS_ISO_8601, $dupFile->getTimestamp() ),
+                                               'shared' => !$dupFile->isLocal(),
                                        );
-                                       if ( !$dupFile->isLocal() ) {
-                                               $r['shared'] = '';
-                                       }
                                        $fit = $this->addPageSubItem( $pageId, $r );
                                        if ( !$fit ) {
                                                $this->setContinueEnumParameter( 'continue', $image . '|' . $dupName );
@@ -191,6 +189,6 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
        }
 
        public function getHelpUrls() {
-               return 'https://www.mediawiki.org/wiki/API:Properties#duplicatefiles_.2F_df';
+               return 'https://www.mediawiki.org/wiki/API:Duplicatefiles';
        }
 }