<!DOCTYPE html>
<meta charset="utf-8">
<?php
require_once 'PlainText.php';
require_once 'UpperCaseText.php';
require_once 'DoubleByteText.php';
$text = new PlainText();
$text->setText('Decorator Pattern.');
//テキストを大文字にして返す機能を追加
$text = new UpperCaseText($text);
/*
//テキストを全角文字にして返す機能を追加
$text = new DoubleByteText($text);
*/
echo $text->getText();