php适配器模式

<?php
/**
* Created by PhpStorm.
* User: v.liumin
* Date: 2016/8/10
* Time: 11:17
*/
interface Target {
public function simpleMethod1();
public function simpleMethod2();
}

class Adaptree{
public function simpleMethod1(){
echo 22;
}
}

class Adapter implements Target {
private $adaptree;

public function __construct()
{
$this->adaptree = new Adaptree();
}

public function simpleMethod1()
{
$this->adaptree->simpleMethod1();
}

public function simpleMethod2()
{
echo 22;
}

}
原文地址:https://www.cnblogs.com/best-jobs/p/5756036.html