mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
PHP7 Decorator
This commit is contained in:
11
Structural/Decorator/JsonRenderer.php
Normal file
11
Structural/Decorator/JsonRenderer.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Structural\Decorator;
|
||||
|
||||
class JsonRenderer extends RendererDecorator
|
||||
{
|
||||
public function renderData(): string
|
||||
{
|
||||
return json_encode($this->wrapped->renderData());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user