I recently stumbled upon a service class provided by our project framework which I had to use to implement a new feature into a project. It was quite a large class but that's fine because it takes away a lot of effort for me.
There was just one problem. I needed one tiny line to be placed inside a function of this service to make it work seamlessly with my existing code. Unfortunately, there was no way to hook into the function in any way. So usually I would extend or decorate the function and overwrite it in the dependency injection container. Sound simple. Just extend the class, overwrite the function, add the custom part and done.
Instead, it wasn't. Because someone made all properties and methods (except for a few)
private. Which means I have no way of accessing anything from my subclass. WHY WOULD YOU DO THIS. If you create a framework and provide services and stuff. Don't assume that you thought of every use case possible.
Now I had to copy the whole class just to insert a single line! This not only makes me a bit angry but also is really ugly 🤮