Design Pattern: Adapter Pattern in PHP
Adapter pattern is used to convert the interface of a class to another interface, so that the existing class can be adapted to the desired new behavior. This way an existing class can adapt to a new functionality with any direct change to it. Sometimes we want to use some existing class(es), for some functionality, but the interface of the classes does not match with the new requirement. Adapter pattern is used in that case. This article is about Adapter pattern implementations in PHP.