mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-12 18:04:04 +02:00
Applied fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
3663603b80
commit
fe1f144ec3
@@ -15,7 +15,7 @@ class Form extends FormElement
|
||||
|
||||
/**
|
||||
* runs through all elements and calls render() on them, then returns the complete representation
|
||||
* of the form
|
||||
* of the form.
|
||||
*
|
||||
* from the outside, one will not see this and the form will act like a single object instance
|
||||
*
|
||||
@@ -28,7 +28,7 @@ class Form extends FormElement
|
||||
$formCode = '';
|
||||
|
||||
foreach ($this->elements as $element) {
|
||||
$formCode .= $element->render($indent + 1) . PHP_EOL;
|
||||
$formCode .= $element->render($indent + 1).PHP_EOL;
|
||||
}
|
||||
|
||||
return $formCode;
|
||||
|
@@ -3,12 +3,12 @@
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
/**
|
||||
* Class FormElement
|
||||
* Class FormElement.
|
||||
*/
|
||||
abstract class FormElement
|
||||
{
|
||||
/**
|
||||
* renders the elements' code
|
||||
* renders the elements' code.
|
||||
*
|
||||
* @param int $indent
|
||||
*
|
||||
|
@@ -3,12 +3,12 @@
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
/**
|
||||
* Class InputElement
|
||||
* Class InputElement.
|
||||
*/
|
||||
class InputElement extends FormElement
|
||||
{
|
||||
/**
|
||||
* renders the input element HTML
|
||||
* renders the input element HTML.
|
||||
*
|
||||
* @param int $indent
|
||||
*
|
||||
@@ -16,6 +16,6 @@ class InputElement extends FormElement
|
||||
*/
|
||||
public function render($indent = 0)
|
||||
{
|
||||
return str_repeat(' ', $indent) . '<input type="text" />';
|
||||
return str_repeat(' ', $indent).'<input type="text" />';
|
||||
}
|
||||
}
|
||||
|
@@ -5,11 +5,10 @@ namespace DesignPatterns\Structural\Composite\Tests;
|
||||
use DesignPatterns\Structural\Composite;
|
||||
|
||||
/**
|
||||
* FormTest tests the composite pattern on Form
|
||||
* FormTest tests the composite pattern on Form.
|
||||
*/
|
||||
class CompositeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testRender()
|
||||
{
|
||||
$form = new Composite\Form();
|
||||
@@ -25,7 +24,7 @@ class CompositeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* The all point of this pattern, a Composite must inherit from the node
|
||||
* if you want to builld trees
|
||||
* if you want to builld trees.
|
||||
*/
|
||||
public function testFormImplementsFormEelement()
|
||||
{
|
||||
|
@@ -3,12 +3,12 @@
|
||||
namespace DesignPatterns\Structural\Composite;
|
||||
|
||||
/**
|
||||
* Class TextElement
|
||||
* Class TextElement.
|
||||
*/
|
||||
class TextElement extends FormElement
|
||||
{
|
||||
/**
|
||||
* renders the text element
|
||||
* renders the text element.
|
||||
*
|
||||
* @param int $indent
|
||||
*
|
||||
@@ -16,6 +16,6 @@ class TextElement extends FormElement
|
||||
*/
|
||||
public function render($indent = 0)
|
||||
{
|
||||
return str_repeat(' ', $indent) . 'this is a text element';
|
||||
return str_repeat(' ', $indent).'this is a text element';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user