@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Bridge; |
| 6 | 6 | |
| 7 | -abstract class Service |
|
| 8 | -{ |
|
| 7 | +abstract class Service |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var \DesignPattern\Structural\Bridge\FormatterInterface |
| 11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param \DesignPattern\Structural\Bridge\FormatterInterface $formatter |
| 18 | 18 | */ |
| 19 | - public function __construct(FormatterInterface $formatter) |
|
| 20 | - { |
|
| 19 | + public function __construct(FormatterInterface $formatter) |
|
| 20 | + {
|
|
| 21 | 21 | $this->formatter = $formatter; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Adapter; |
| 6 | 6 | |
| 7 | -class UserAdapter implements UserInterface |
|
| 8 | -{ |
|
| 7 | +class UserAdapter implements UserInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var \DesignPattern\Structural\Adapter\MemberInterface |
| 11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param \DesignPattern\Structural\Adapter\MemberInterface $member |
| 18 | 18 | */ |
| 19 | - public function __construct(MemberInterface $member) |
|
| 20 | - { |
|
| 19 | + public function __construct(MemberInterface $member) |
|
| 20 | + {
|
|
| 21 | 21 | $this->member = $member; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Flyweight; |
| 6 | 6 | |
| 7 | -class Gun |
|
| 8 | -{ |
|
| 7 | +class Gun |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var array|BulletInterface[] |
| 11 | 11 | */ |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param int $maxBullets |
| 23 | 23 | */ |
| 24 | - public function __construct(int $maxBullets) |
|
| 25 | - { |
|
| 24 | + public function __construct(int $maxBullets) |
|
| 25 | + {
|
|
| 26 | 26 | $this->bullets = []; |
| 27 | 27 | $this->maxBullets = $maxBullets; |
| 28 | 28 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | public function reload(string $type): void |
| 52 | 52 | { |
| 53 | 53 | $count = count($this->bullets); |
| 54 | - for (; $count < $this->maxBullets; $count++) { |
|
| 54 | + for (; $count < $this->maxBullets; $count++) {
|
|
| 55 | 55 | $this->bullets[] = BulletFactory::getInstance($type); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function fire(): string |
| 63 | 63 | { |
| 64 | - if ($count = count($this->bullets)) { |
|
| 64 | + if ($count = count($this->bullets)) {
|
|
| 65 | 65 | $bullet = array_shift($this->bullets); |
| 66 | 66 | $bullet->setPositionInMagazine($this->maxBullets - $count + 1); |
| 67 | 67 | |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Flyweight; |
| 6 | 6 | |
| 7 | -interface BulletInterface |
|
| 8 | -{ |
|
| 7 | +interface BulletInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @param int $position |
| 11 | 11 | */ |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Facade; |
| 6 | 6 | |
| 7 | -class Facade |
|
| 8 | -{ |
|
| 7 | +class Facade |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var \DesignPattern\Structural\Facade\BiosInterface |
| 11 | 11 | */ |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @param \DesignPattern\Structural\Facade\BiosInterface $bios |
| 23 | 23 | * @param \DesignPattern\Structural\Facade\MacOSInterface $macOS |
| 24 | 24 | */ |
| 25 | - public function __construct(BiosInterface $bios, MacOSInterface $macOS) |
|
| 26 | - { |
|
| 25 | + public function __construct(BiosInterface $bios, MacOSInterface $macOS) |
|
| 26 | + {
|
|
| 27 | 27 | $this->bios = $bios; |
| 28 | 28 | $this->macOS = $macOS; |
| 29 | 29 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Structural\Composite; |
| 6 | 6 | |
| 7 | -class InputElement implements RenderableInterface |
|
| 8 | -{ |
|
| 7 | +class InputElement implements RenderableInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @var string |
| 11 | 11 | */ |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @param string $name |
| 23 | 23 | * @param string $type |
| 24 | 24 | */ |
| 25 | - public function __construct(string $name, string $type = 'text') |
|
| 26 | - { |
|
| 25 | + public function __construct(string $name, string $type = 'text') |
|
| 26 | + {
|
|
| 27 | 27 | $this->name = $name; |
| 28 | 28 | $this->type = $type; |
| 29 | 29 | } |
@@ -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\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 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Behavioral\Specification; |
| 6 | 6 | |
| 7 | -interface SpecificationInterface |
|
| 8 | -{ |
|
| 7 | +interface SpecificationInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @param Item $item |
| 11 | 11 | * |