value = $value; } public function setContainer( ContainerInterface $container ) { $this->container = $container; } public function setFormatter( FormatterInterface $formatter ) { $this->formatter = $formatter; } public function esc_raw() { return htmlentities( $this->value ); } abstract public function decode(); public function __toString() { $value = $this->decode(); $formatted = $this->formatter->format( $value ); return $this->container->wrap( $formatted ); } } class ActionQuotedPrintableDecode extends AbstractAction { public function __construct( $value ) { parent::__construct( $value ); $this->setContainer( new TextareaContainer ); $this->setFormatter( new EchoFormatter ); } public function decode() { return quoted_printable_decode( $this->value ); } } class ActionUrldecode extends AbstractAction { public function __construct( $value ) { parent::__construct( $value ); $this->setContainer( new TextareaContainer ); $this->setFormatter( new EchoFormatter ); } public function decode() { return urldecode( $this->value ); } } class ActionUrlencode extends AbstractAction { public function __construct( $value ) { parent::__construct( $value ); $this->setContainer( new TextareaContainer ); $this->setFormatter( new EchoFormatter ); } public function decode() { return urlencode( $this->value ); } } class ActionUnserialize extends AbstractAction { public function __construct( $value ) { parent::__construct( $value ); $this->setContainer( new DivContainer ); $this->setFormatter( new DbugFormatter ); } public function decode() { return unserialize( $this->value ); } } interface ContainerInterface { public function wrap( $contents ); } class DivContainer implements ContainerInterface { public function wrap( $contents ) { return '