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

Refactor files_sharing app commands #39898

Conversation

fsamapoor
Copy link
Member

Summary

I have made some adjustments to the apps/files_sharing/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 16, 2023 10:45
To improve code readability.

Signed-off-by: Faraz Samapoor <[email protected]>
To improve code readability.

Signed-off-by: Faraz Samapoor <[email protected]>
@fsamapoor fsamapoor added 3. to review Waiting for reviews technical debt labels Aug 16, 2023
@fsamapoor fsamapoor added this to the Nextcloud 28 milestone Aug 16, 2023
}

public function countFiles($numericId, OutputInterface $output) {
public function countFiles($numericId, OutputInterface $output): void {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $numericId has no provided type
@@ -118,7 +112,7 @@
$output->writeln("$count files can be deleted for storage $numericId");
}

public function deleteStorage($id, $numericId, OutputInterface $output) {
public function deleteStorage($id, $numericId, OutputInterface $output): void {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $id has no provided type
@@ -118,7 +112,7 @@
$output->writeln("$count files can be deleted for storage $numericId");
}

public function deleteStorage($id, $numericId, OutputInterface $output) {
public function deleteStorage($id, $numericId, OutputInterface $output): void {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $numericId has no provided type
@@ -132,7 +126,7 @@
$this->deleteFiles($numericId, $output);
}

public function deleteFiles($numericId, OutputInterface $output) {
public function deleteFiles($numericId, OutputInterface $output): void {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $numericId has no provided type
@fsamapoor fsamapoor requested review from a team, ArtificialOwl, icewind1991 and blizzz and removed request for a team August 16, 2023 07:50
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@fsamapoor fsamapoor closed this Mar 8, 2024
@fsamapoor fsamapoor deleted the refactor_files_sharing_app_commands branch March 8, 2024 07:42
@fsamapoor fsamapoor restored the refactor_files_sharing_app_commands branch March 8, 2024 07:42
@skjnldsv skjnldsv removed this from the Nextcloud 29 milestone Aug 14, 2024
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.

3 participants