Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors files version app commands. #39695

Merged

Conversation

fsamapoor
Copy link
Member

Summary

I have made some adjustments to the apps/files_version/lib/Command classes to improve the code readability.

The improvements in this PR include but are not limited to:

  • Using PHP8's constructor property promotion
  • Adding return types
  • Replacing return code integers with more readable strings.
  • Using early returns

Checklist

Faraz Samapoor added 2 commits August 3, 2023 16:35
To improve code readability.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
To improve code readability.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>

$output->writeln("Remove deleted files of <info>$user</info>");
$userObject = $this->userManager->get($user);
$this->expireVersionsForUser($userObject);

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of OCA\Files_Versions\Command\ExpireVersions::expireVersionsForUser cannot be null, possibly null value provided
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

apps/files_versions/lib/Command/CleanUp.php Outdated Show resolved Hide resolved
apps/files_versions/lib/Command/Expire.php Outdated Show resolved Hide resolved
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
@come-nc come-nc merged commit 39d4c87 into nextcloud:master Sep 21, 2023
31 of 37 checks passed
@fsamapoor fsamapoor deleted the refactor_files_version_app_commands branch September 21, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants