@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Composite; |
| 6 | 6 | |
| 7 | -interface RenderableInterface |
|
| 8 | -{ |
|
| 7 | +interface RenderableInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Render HTML element. |
| 11 | 11 | * |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Composite; |
| 4 | 4 | |
| 5 | -class LabelElement implements RenderableInterface |
|
| 6 | -{ |
|
| 5 | +class LabelElement implements RenderableInterface |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @var string |
| 9 | 9 | */ |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | * @param string $for |
| 21 | 21 | * @param string $name |
| 22 | 22 | */ |
| 23 | - public function __construct(string $for, string $name = 'Label Name:') |
|
| 24 | - { |
|
| 23 | + public function __construct(string $for, string $name = 'Label Name:') |
|
| 24 | + {
|
|
| 25 | 25 | $this->for = $for; |
| 26 | 26 | $this->name = $name; |
| 27 | 27 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Composite; |
| 6 | 6 | |
| 7 | -class Form implements RenderableInterface |
|
| 8 | -{ |
|
| 7 | +class Form implements RenderableInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var string |
| 11 | 11 | */ |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | * @param string $action |
| 33 | 33 | * @param string $name |
| 34 | 34 | */ |
| 35 | - public function __construct(string $action = '', string $name = '') |
|
| 36 | - { |
|
| 35 | + public function __construct(string $action = '', string $name = '') |
|
| 36 | + {
|
|
| 37 | 37 | $this->action = $action; |
| 38 | 38 | $this->name = $name; |
| 39 | 39 | } |
@@ -48,16 +48,16 @@ discard block |
||
| 48 | 48 | static $i = 0; |
| 49 | 49 | $form = ''; |
| 50 | 50 | |
| 51 | - if ($i === 0) { |
|
| 51 | + if ($i === 0) {
|
|
| 52 | 52 | $form .= '<form action="%s" name="%s">'; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - foreach ($this->elements as $element) { |
|
| 55 | + foreach ($this->elements as $element) {
|
|
| 56 | 56 | $form .= $element->render(); |
| 57 | 57 | ++$i; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if ($i === self::$elementNumber) { |
|
| 60 | + if ($i === self::$elementNumber) {
|
|
| 61 | 61 | $form .= '</form>'; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Decorator; |
| 4 | 4 | |
| 5 | -abstract class RendererDecorator |
|
| 6 | -{ |
|
| 5 | +abstract class RendererDecorator |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @var \DesignPattern\Structural\Decorator\RenderableInterface |
| 9 | 9 | */ |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @param \DesignPattern\Structural\Decorator\RenderableInterface $renderable |
| 16 | 16 | */ |
| 17 | - public function __construct(RenderableInterface $renderable) |
|
| 18 | - { |
|
| 17 | + public function __construct(RenderableInterface $renderable) |
|
| 18 | + {
|
|
| 19 | 19 | $this->renderable = $renderable; |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Decorator; |
| 4 | 4 | |
| 5 | -class JsonRender extends RendererDecorator |
|
| 6 | -{ |
|
| 5 | +class JsonRender extends RendererDecorator |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @return string |
| 9 | 9 | */ |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Decorator; |
| 4 | 4 | |
| 5 | -class XmlRender extends RendererDecorator |
|
| 6 | -{ |
|
| 5 | +class XmlRender extends RendererDecorator |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @return string |
| 9 | 9 | */ |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Decorator; |
| 4 | 4 | |
| 5 | -interface RenderableInterface |
|
| 6 | -{ |
|
| 5 | +interface RenderableInterface |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @return string |
| 9 | 9 | */ |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Decorator; |
| 4 | 4 | |
| 5 | -class Webservice implements RenderableInterface |
|
| 6 | -{ |
|
| 5 | +class Webservice implements RenderableInterface |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @var string |
| 9 | 9 | */ |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @param string $data |
| 16 | 16 | */ |
| 17 | - public function __construct(string $data) |
|
| 18 | - { |
|
| 17 | + public function __construct(string $data) |
|
| 18 | + {
|
|
| 19 | 19 | $this->data = $data; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Registry; |
| 4 | 4 | |
| 5 | -abstract class Registry |
|
| 6 | -{ |
|
| 5 | +abstract class Registry |
|
| 6 | +{
|
|
| 7 | 7 | public const LOGGER = 'logger'; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @return mixed |
| 20 | 20 | */ |
| 21 | - public static function get(string $key) |
|
| 22 | - { |
|
| 21 | + public static function get(string $key) |
|
| 22 | + {
|
|
| 23 | 23 | return self::$collection[$key]; |
| 24 | 24 | } |
| 25 | 25 | |