-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Move more logic from addMountPoint into separate functions #8583
Conversation
🚀 Test Passed. 🚀 |
Create some unit tests and you will get my +1 ;-) |
@LukasReschke The new functions are private, and are used in existing functions (which have unit tests already), so how would that work? |
Btw. I can't find an unittest for removeMountPoint. If we have unittests for all public functions then testing the private ones is not relevant anymore. |
@LukasReschke Done 😄 |
🚀 Test Passed. 🚀 |
if (is_null($user)) { | ||
return true; | ||
} else { | ||
if (isset($personalBackends[$backend])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge into "else if"
🚀 Test Passed. 🚀 |
@Xenopathic before refactoring, please make sure that we're fixing an actual issue and that there is a direct need for it. The code looks good but haven't had time to test it yet. |
Still, kudos for making the code more readable 😄 |
Please rebase |
I split the new priority code into a separate function - see |
💣 Test Failed. 💣 |
🚀 Test Passed. 🚀 |
I didn't have time to test this yet, sorry. @DeepDiver1975 are you ok with this PR ? |
@LukasReschke the unit tests are here, can you have a another look ? |
I had a quick test and adding mount points still work. 👍 Needs a second reviewer @LukasReschke @icewind1991 |
@Xenopathic please rebase |
💣 Test Failed. 💣 |
A new inspection was created. |
Is this something that we want merged then? As you say @PVince81, it does make the code significantly more readable, but it also paves the way for another PR I have planned (when I get the next version my other project released). In that case, this needs a second reviewer. @LukasReschke you happy with this now? |
Trouble is we are already past feature freeze, so it might need to wait for OC 8 to be merged, sorry :-/ |
🚀 Test Passed. 🚀 |
OK, in that case this can wait: it doesn't significantly affect performance |
@bantu you'll probably enjoy reviewing this refactoring ? |
💣 Test FAILed. 💣 |
💣 Test FAILed. 💣 |
@Xenopathic do we still want this ? |
@PVince81 Yeah, let's kill it. I'll leave the branch though, in case someone can benefit from the changed code |
@Xenopathic You can always restore the branch here on github, if you want ;) |
@MorrisJobke For the time being, at least until GitHub does garbage collection :) |
I will get Scrutinizer to give something higher than an F for addMountPoint... also this reduces duplicated code and (IMO) makes the logic a bit clearer