I have a legacy API in PHP that I need to refactor. The request must include an operation (eg. 'get_some_data') which is determined in a massive if/else sequence. All refactoring recommendations I find online consist of converting procedural to OOP, but in this application there is not really a logical grouping of the operations.
Is there some best practises (or good tips) you have for refactoring a project like this? The final goal is full automated test coverage.