适配器在 PHP 中的实现
Adapter is a structural design pattern, which allows incompatible objects to collaborate.
The Adapter acts as a wrapper between two objects, It catches calls for one object and transforms them to format and interface recognizable by the second object.
在 PHP 中使用模式
Usage examples: The Adapter pattern is pretty common in PHP code. It's very often used in systems based on some legacy code. In such cases, Adapters make legacy code with modern classes.