-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Refactor files_trashbin app commands #39882
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
Closed
fsamapoor
wants to merge
2
commits into
nextcloud:master
from
fsamapoor:refactor_files_trashbin_app_commands
Closed
Refactor files_trashbin app commands #39882
fsamapoor
wants to merge
2
commits into
nextcloud:master
from
fsamapoor:refactor_files_trashbin_app_commands
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $query->delete('files_trash') | ||
| ->where($query->expr()->eq('user', $query->createParameter('uid'))) | ||
| ->setParameter('uid', $uid); | ||
| $query->execute(); |
Check notice
Code scanning / Psalm
DeprecatedMethod
The method OCP\DB\QueryBuilder\IQueryBuilder::execute has been marked as deprecated
| $userObject = $this->userManager->get($user); | ||
| $this->expireTrashForUser($userObject); | ||
| } else { | ||
| if (! $this->userManager->userExists($user)) { |
Check notice
Code scanning / Psalm
PossiblyNullReference
Cannot call method userExists on possibly null value
|
|
||
| $output->writeln("Remove deleted files of <info>$user</info>"); | ||
| $userObject = $this->userManager->get($user); | ||
| $this->expireTrashForUser($userObject); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
Argument 1 of OCA\Files_Trashbin\Command\ExpireTrash::expireTrashForUser cannot be null, possibly null value provided
|
|
||
| $p = new ProgressBar($output); | ||
| $p->start(); | ||
| $this->userManager->callForSeenUsers(function (IUser $user) use ($p) { |
Check notice
Code scanning / Psalm
PossiblyNullReference
Cannot call method callForSeenUsers on possibly null value
42794ad to
35b0f7a
Compare
Member
Author
|
Conflicts resolved! |
Merged
35b0f7a to
e5e9aed
Compare
e5e9aed to
e085779
Compare
To improve code readability. Signed-off-by: Faraz Samapoor <[email protected]>
To improve code readability. Signed-off-by: Faraz Samapoor <[email protected]>
e085779 to
754b425
Compare
This was referenced Mar 12, 2024
Merged
Merged
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I have made some adjustments to the
apps/files_trashbin/lib/Commandclasses to improve the code readability.The improvements in this PR include but are not limited to:
Checklist