remove Interface-Suffix

This commit is contained in:
Dominik Liebler
2019-08-19 17:12:29 +02:00
parent dba45b8098
commit 963041982e
7 changed files with 9 additions and 32 deletions

View File

@ -7,10 +7,10 @@ namespace DesignPatterns\Structural\Composite;
* The composite node MUST extend the component contract. This is mandatory for building * The composite node MUST extend the component contract. This is mandatory for building
* a tree of components. * a tree of components.
*/ */
class Form implements RenderableInterface class Form implements Renderable
{ {
/** /**
* @var RenderableInterface[] * @var Renderable[]
*/ */
private $elements; private $elements;
@ -36,9 +36,9 @@ class Form implements RenderableInterface
} }
/** /**
* @param RenderableInterface $element * @param Renderable $element
*/ */
public function addElement(RenderableInterface $element) public function addElement(Renderable $element)
{ {
$this->elements[] = $element; $this->elements[] = $element;
} }

View File

@ -3,7 +3,7 @@ declare(strict_types=1);
namespace DesignPatterns\Structural\Composite; namespace DesignPatterns\Structural\Composite;
class InputElement implements RenderableInterface class InputElement implements Renderable
{ {
public function render(): string public function render(): string
{ {

View File

@ -26,9 +26,9 @@ Code
You can also find this code on `GitHub`_ You can also find this code on `GitHub`_
RenderableInterface.php Renderable.php
.. literalinclude:: RenderableInterface.php .. literalinclude:: Renderable.php
:language: php :language: php
:linenos: :linenos:

View File

@ -3,7 +3,7 @@ declare(strict_types=1);
namespace DesignPatterns\Structural\Composite; namespace DesignPatterns\Structural\Composite;
interface RenderableInterface interface Renderable
{ {
public function render(): string; public function render(): string;
} }

View File

@ -3,7 +3,7 @@ declare(strict_types=1);
namespace DesignPatterns\Structural\Composite; namespace DesignPatterns\Structural\Composite;
class TextElement implements RenderableInterface class TextElement implements Renderable
{ {
/** /**
* @var string * @var string

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,23 +0,0 @@
@startuml
class Form {
#elements : array|FormElement[]
+render($indent = 0 : int)
+addElement(FormElement $element)
}
abstract class FormElement {
+render($indent = 0 : int)
}
class InputElement {
+render($indent = 0 : int)
}
class TextElement {
+render($indent = 0 : int)
}
FormElement <|.. TextElement
FormElement <|.. InputElement
FormElement <|.. Form
@enduml