Skip to content

Commit

Permalink
Fix linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-rainville committed Jun 25, 2020
1 parent de9b93f commit 6f04f95
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions code/Task/RecoverUploadLocationsHelper.php
Expand Up @@ -62,7 +62,7 @@ class RecoverUploadLocationsHelper

/**
* Cache of the EditableFileField versions
*
*
* @var EditableFileField
*/
private $fieldFolderCache = array();
Expand Down Expand Up @@ -115,7 +115,7 @@ public function run()

/**
* Process all the files and return the number
*
*
* @return int Number of files processed
*/
protected function process()
Expand All @@ -134,7 +134,7 @@ protected function process()
$errorsCount = 0;

// Loop over the files to process
foreach($this->chunk() as $uploadRecord) {
foreach ($this->chunk() as $uploadRecord) {
++$processedCount;

$fileId = $uploadRecord['UploadedFileID'];
Expand Down Expand Up @@ -171,10 +171,10 @@ protected function process()

/**
* Fetches the EditableFileField version from cache and returns its FolderID
*
*
* @param int $fieldId EditableFileField.ID
* @param int EditableFileField Version
*
*
* @return int
*/
protected function getExpectedUploadFolderId($fieldId, $fieldVersion)
Expand All @@ -196,11 +196,11 @@ protected function getExpectedUploadFolderId($fieldId, $fieldVersion)
/**
* Fetches a Folder by its ID, gracefully handling
* deleted folders
*
*
* @param int $id Folder.ID
*
*
* @return Folder
*
*
* @throws RuntimeException when folder could not be found
*/
protected function getFolder($id)
Expand Down Expand Up @@ -231,10 +231,10 @@ protected function getFolder($id)

/**
* Recover an uploaded file location
*
*
* @param int $fileId File.ID
* @param int $expectedFolderId ID of the folder where the file should have end up
*
*
* @return int Number of files recovered
*/
protected function recover($fileId, $expectedFolderId)
Expand All @@ -247,7 +247,8 @@ protected function recover($fileId, $expectedFolderId)

if ($this->filesVersioned) {
$draftVersion = Versioned::get_versionnumber_by_stage(File::class, Versioned::DRAFT, $fileId);
$liveVersion = Versioned::get_versionnumber_by_stage(File::class, Versioned::LIVE, $fileId);;
$liveVersion = Versioned::get_versionnumber_by_stage(File::class, Versioned::LIVE, $fileId);
;

if ($draftVersion && $draftVersion != $liveVersion) {
$draft = Versioned::get_version(File::class, $fileId, $draftVersion);
Expand Down Expand Up @@ -305,11 +306,11 @@ protected function recover($fileId, $expectedFolderId)
* when manually moving them to another folder through CMS
*
* @see https://github.com/silverstripe/silverstripe-userforms/issues/944
*
*
* @param int $fileId File.ID
* @param File $file The live version of the file
* @param File|null $draft The draft version of the file
*
*
* @return int Number of files recovered
*/
protected function checkResidual($fileId, File $file, File $draft = null)
Expand Down Expand Up @@ -370,7 +371,7 @@ protected function checkResidual($fileId, File $file, File $draft = null)
*
* @param File $file the file instance
* @param int $expectedFolder The expected folder
*
*
* @return int How many files have been recovered
*/
protected function recoverLiveOnly(File $file, Folder $expectedFolder)
Expand Down Expand Up @@ -560,11 +561,11 @@ private function getQuery()
/**
* Returns DataList object containing every
* uploaded file record
*
*
* @return DataList
*/
private function getCountQuery()
{
return SubmittedFileField::get()->filter(['UploadedFileID:NOT' => 0]);
}
}
}

0 comments on commit 6f04f95

Please sign in to comment.