From 6f04f9537d3db09fa5a90c85dc1b75f1223c8e9b Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Thu, 25 Jun 2020 17:04:20 +1200 Subject: [PATCH] Fix linting issue --- code/Task/RecoverUploadLocationsHelper.php | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/code/Task/RecoverUploadLocationsHelper.php b/code/Task/RecoverUploadLocationsHelper.php index 2b0e8a2db..c0f261db3 100644 --- a/code/Task/RecoverUploadLocationsHelper.php +++ b/code/Task/RecoverUploadLocationsHelper.php @@ -62,7 +62,7 @@ class RecoverUploadLocationsHelper /** * Cache of the EditableFileField versions - * + * * @var EditableFileField */ private $fieldFolderCache = array(); @@ -115,7 +115,7 @@ public function run() /** * Process all the files and return the number - * + * * @return int Number of files processed */ protected function process() @@ -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']; @@ -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) @@ -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) @@ -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) @@ -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); @@ -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) @@ -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) @@ -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]); } -} \ No newline at end of file +}