Repository navigation
Conversation
|
@DeepDiver1975 @PVince81 @icewind1991 @karlitschek @craigpg This is a rather simple refactoring that has been lying around for some time, but still seems to apply. Can we have this? |
|
Is this something you need for another PR ? The commit comment seems to imply that you did this to make the function testable, but it seems that you didn't add any test for those ? |
|
@PVince81 I only refactored this code to get rid of properties properly organised code does not have: global variables, static variables, untestable functions + I made the code reusable and use dependency injection. All this was done in about 10 minutes. I have not written any actual tests for this code. I did not expect this clearly benefitial change to lie around for 3 months or more. This PR is somewhat related to #5499 (comment) which might refactor this code even further, but needs further looking into e.g. due to soft quota. |
|
It would be better to only refactor code when it is associated with fixing a specific issue or implementing a feature, so it can be regression tested as part of that feature. Basically only refactor code that you need to touch anyway for any fix/feature, as it will need to be reviewed/tested anyway. This is why I asked. The refactoring itself might have taken you 10 minutes, but will take more time for reviewers to context switch, dive into the code to understand it, review it, do regression tests (and try to infer test steps from the code if no test plan is provided), time that might be better spent fixing bugs instead, especially that there are still a lot in the tracker. If you add a unit test that confirms that it still works after refactoring and a mini test plan it might save some time when reviewing it. |
|
I agree with @PVince81 |
|
All right. I'll put this into #5499 then. |
Refactor apps/files/ajax/newfile.php
@DeepDiver1975 @PVince81