Closed phrfpeixoto closed 1 week ago
with the new argument, do you actually need to extend the class and call those protected functions ? If yes, why ? If no, I would not change their visibility as making them protected means they become part of the API that is covered by semver (and so they cannot be refactored to change their signature or be removed if the code does not need them anymore)
It doesn't. I've added that specifically to bring that discussion:
Whichever change is less disruptive for the project is OK for me.
IMO, it's likely that you'll want to change the class constructor's signature (other than those helper functions) as time passes, so if you're worried about semver, it would be better to expose those helper methods (they are final
, after all).
@stof Let me know what changes you would prefer.
What's the use case here? Why is 'a'
not good enough? Just curious/trying to understand. But in general I'd say given the edge case-ness here, I feel like a setter might be more appropriate than a constructor arg.
@Seldaek The use case is having the file overwritten, instead of appended.
Thanks
I've included changes to both allow custom
fopen
modes, as well as change the visibility of the helper functions on this class. I've made them final to keep the "do not touch" aspect, while still allowing subclasses to use them.