X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FOldLocalFile.php;h=584e00121188acb12a078fc35eebee12174ccf84;hp=23ff304ec510bab4fdd0787609683fe2245e77fd;hb=94d8579d2c03b579ae83d8503d38aa593c566feb;hpb=36bbdfb8ad5293c6c72960c581d27827cd01dce9 diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index 23ff304ec5..584e001211 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -42,7 +42,7 @@ class OldLocalFile extends LocalFile { * @param Title $title * @param FileRepo $repo * @param string|int|null $time - * @return self + * @return static * @throws MWException */ static function newFromTitle( $title, $repo, $time = null ) { @@ -51,27 +51,27 @@ class OldLocalFile extends LocalFile { throw new MWException( __METHOD__ . ' got null for $time parameter' ); } - return new self( $title, $repo, $time, null ); + return new static( $title, $repo, $time, null ); } /** * @param Title $title * @param FileRepo $repo * @param string $archiveName - * @return self + * @return static */ static function newFromArchiveName( $title, $repo, $archiveName ) { - return new self( $title, $repo, null, $archiveName ); + return new static( $title, $repo, null, $archiveName ); } /** * @param stdClass $row * @param FileRepo $repo - * @return self + * @return static */ static function newFromRow( $row, $repo ) { $title = Title::makeTitle( NS_FILE, $row->oi_name ); - $file = new self( $title, $repo, null, $row->oi_archive_name ); + $file = new static( $title, $repo, null, $row->oi_archive_name ); $file->loadFromRow( $row, 'oi_' ); return $file; @@ -95,12 +95,12 @@ class OldLocalFile extends LocalFile { $conds['oi_timestamp'] = $dbr->timestamp( $timestamp ); } - $fileQuery = self::getQueryInfo(); + $fileQuery = static::getQueryInfo(); $row = $dbr->selectRow( $fileQuery['tables'], $fileQuery['fields'], $conds, __METHOD__, [], $fileQuery['joins'] ); if ( $row ) { - return self::newFromRow( $row, $repo ); + return static::newFromRow( $row, $repo ); } else { return false; } @@ -418,10 +418,10 @@ class OldLocalFile extends LocalFile { $dstRel = $this->getArchiveRel( $archiveName ); $status = $this->publishTo( $srcPath, $dstRel ); - if ( $status->isGood() ) { - if ( !$this->recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) ) { - $status->fatal( 'filenotfound', $srcPath ); - } + if ( $status->isGood() && + !$this->recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) + ) { + $status->fatal( 'filenotfound', $srcPath ); } $this->unlock();