mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-01-17 21:48:59 +01:00
remove Interface-Suffix
This commit is contained in:
parent
dba45b8098
commit
963041982e
@ -7,10 +7,10 @@ namespace DesignPatterns\Structural\Composite;
|
||||
* The composite node MUST extend the component contract. This is mandatory for building
|
||||
* a tree of components.
|
||||
*/
|
||||
class Form implements RenderableInterface
|
||||
class Form implements Renderable
|
||||
{
|
||||
/**
|
||||
* @var RenderableInterface[]
|
||||
* @var Renderable[]
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
class InputElement implements RenderableInterface
|
||||
class InputElement implements Renderable
|
||||
{
|
||||
public function render(): string
|
||||
{
|
||||
|
@ -26,9 +26,9 @@ Code
|
||||
|
||||
You can also find this code on `GitHub`_
|
||||
|
||||
RenderableInterface.php
|
||||
Renderable.php
|
||||
|
||||
.. literalinclude:: RenderableInterface.php
|
||||
.. literalinclude:: Renderable.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
interface RenderableInterface
|
||||
interface Renderable
|
||||
{
|
||||
public function render(): string;
|
||||
}
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
class TextElement implements RenderableInterface
|
||||
class TextElement implements Renderable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 30 KiB |
@ -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
|
Loading…
x
Reference in New Issue
Block a user