I have always had a hard time understanding the real value of Interfaces when coding with Objects in PHP (could be other languages I imagine)
From what I understand you use an Interface
to enforce or guarantee that when a Class is using an Interface
that that class will have the methods defined in the Interface
inside of that class.
So from my litte knowledge of using them, wouldn't that mean you would only find an Interface
beneficial when defining more then 1 class that needs those Methods?
To be more clear, if I have a class that does one thing and no other classes need to do that kind of thing, then it would be pointless to use an Interface
on that class?
So you wouldn't use an Interface
on EVERY class you right?
PS) If you vote this question as exact duplicate
then you didn't read the question and only the title as I have read most of the similar questions already