Is there any way to redefine a class or some of it's methods without using typical inheritance ex:
class third_party_library {
function buggy_function() {
return 'bad result';
}
function other_functions(){
return 'blah';
}
}
what can I do to replace the buggy_function? Obviously this is what i would like to do
class third_party_library redefines third_party_library{
function buggy_function() {
return 'good result';
}
function other_functions(){
return 'blah';
}
}
This is my exact delima, i did an update to a third party library that breaks my code. I don't want to modify the library directly, as future updates could break the code again. I'm looking for a seamless way to replace the class method.
I've found this library that says it can do it, but I'm weary as it's 4 years old
EDIT:
I should have clarified that I cannot rename the class from third_party_library to magical_third_party_library or anything else due to the framework i'm using
For my purposes it would be possible to just add a function to the class? I think you can do this in c# with something called a "partial class"