@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\SimpleFactory; |
| 6 | 6 | |
| 7 | -class Java implements LanguageInterface |
|
| 8 | -{ |
|
| 7 | +class Java implements LanguageInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Java language write application. |
| 11 | 11 | * |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\FactoryMethod; |
| 6 | 6 | |
| 7 | -interface NotebookInterface |
|
| 8 | -{ |
|
| 7 | +interface NotebookInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Set the color of the Notebook. |
| 11 | 11 | * |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\FactoryMethod; |
| 6 | 6 | |
| 7 | -abstract class FactoryMethod |
|
| 8 | -{ |
|
| 7 | +abstract class FactoryMethod |
|
| 8 | +{
|
|
| 9 | 9 | public const LOW_CONFIG = 1; |
| 10 | 10 | public const MEDIUM_CONFIG = 2; |
| 11 | 11 | public const HIGH_CONFIG = 3; |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\Pool; |
| 6 | 6 | |
| 7 | -class StringReverseWorker |
|
| 8 | -{ |
|
| 7 | +class StringReverseWorker |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var \DateTime |
| 11 | 11 | */ |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * StringReverseWorker constructor. |
| 16 | 16 | */ |
| 17 | - public function __construct() |
|
| 18 | - { |
|
| 17 | + public function __construct() |
|
| 18 | + {
|
|
| 19 | 19 | $this->createdAt = new \DateTime(); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\Pool; |
| 6 | 6 | |
| 7 | -class Pool implements \Countable |
|
| 8 | -{ |
|
| 7 | +class Pool implements \Countable |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var array StringReverseWorker[] |
| 11 | 11 | */ |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function get(): StringReverseWorker |
| 25 | 25 | { |
| 26 | - if (count($this->freeWorker) === 0) { |
|
| 26 | + if (count($this->freeWorker) === 0) {
|
|
| 27 | 27 | $worker = new StringReverseWorker(); |
| 28 | - } else { |
|
| 28 | + } else {
|
|
| 29 | 29 | $worker = array_pop($this->freeWorker); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $key = spl_object_hash($worker); |
| 45 | 45 | |
| 46 | - if (isset($this->usedWorker[$key])) { |
|
| 46 | + if (isset($this->usedWorker[$key])) {
|
|
| 47 | 47 | unset($this->usedWorker[$key]); |
| 48 | 48 | $this->freeWorker[$key] = $worker; |
| 49 | 49 | } |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\AbstractFactory; |
| 6 | 6 | |
| 7 | -abstract class AbstractFactory |
|
| 8 | -{ |
|
| 7 | +abstract class AbstractFactory |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Create a Image component. |
| 11 | 11 | * |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | use DesignPattern\Creational\AbstractFactory\Html\Image as HtmlImage; |
| 8 | 8 | use DesignPattern\Creational\AbstractFactory\Html\Text as HtmlText; |
| 9 | 9 | |
| 10 | -class HtmlFactory extends AbstractFactory |
|
| 11 | -{ |
|
| 10 | +class HtmlFactory extends AbstractFactory |
|
| 11 | +{
|
|
| 12 | 12 | /** |
| 13 | 13 | * Create a Image component implementation. |
| 14 | 14 | * |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\AbstractFactory; |
| 6 | 6 | |
| 7 | -interface RendererInterface |
|
| 8 | -{ |
|
| 7 | +interface RendererInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Render from Json or Html output. |
| 11 | 11 | * |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | use DesignPattern\Creational\AbstractFactory\Image as BaseImage; |
| 8 | 8 | |
| 9 | -class Image extends BaseImage |
|
| 10 | -{ |
|
| 9 | +class Image extends BaseImage |
|
| 10 | +{
|
|
| 11 | 11 | /** |
| 12 | 12 | * Render html image. |
| 13 | 13 | * |