@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\StaticFactory; |
| 6 | 6 | |
| 7 | -class FormatterNumber implements FormatterInterface |
|
| 8 | -{ |
|
| 7 | +class FormatterNumber implements FormatterInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Format value. |
| 11 | 11 | * |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\StaticFactory; |
| 6 | 6 | |
| 7 | -class FormatterString implements FormatterInterface |
|
| 8 | -{ |
|
| 7 | +class FormatterString implements FormatterInterface |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Format value. |
| 11 | 11 | * |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $class = __NAMESPACE__ . '\Formatter' . ucfirst($type); |
| 21 | 21 | |
| 22 | - if (! class_exists($class)) { |
|
| 22 | + if ( ! class_exists($class)) { |
|
| 23 | 23 | throw new \InvalidArgumentException("$class is not found."); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\StaticFactory; |
| 6 | 6 | |
| 7 | -final class StaticFactory |
|
| 8 | -{ |
|
| 7 | +final class StaticFactory |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Create a static factory class. |
| 11 | 11 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $class = __NAMESPACE__ . '\Formatter' . ucfirst($type); |
| 21 | 21 | |
| 22 | - if (! class_exists($class)) { |
|
| 22 | + if (! class_exists($class)) {
|
|
| 23 | 23 | throw new \InvalidArgumentException("$class is not found."); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -4,12 +4,12 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\Prototype; |
| 6 | 6 | |
| 7 | -class BarPrototype extends Prototype |
|
| 8 | -{ |
|
| 7 | +class BarPrototype extends Prototype |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Empty clone. |
| 11 | 11 | */ |
| 12 | - public function __clone() |
|
| 13 | - { |
|
| 12 | + public function __clone() |
|
| 13 | + {
|
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\Prototype; |
| 6 | 6 | |
| 7 | -abstract class Prototype |
|
| 8 | -{ |
|
| 7 | +abstract class Prototype |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * @return mixed |
| 11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @return bool |
| 18 | 18 | */ |
| 19 | - public function __isset(string $property) |
|
| 20 | - { |
|
| 19 | + public function __isset(string $property) |
|
| 20 | + {
|
|
| 21 | 21 | return isset($this->{$property}); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | * @param string $property |
| 26 | 26 | * @param mixed $value |
| 27 | 27 | */ |
| 28 | - public function __set(string $property, $value) |
|
| 29 | - { |
|
| 28 | + public function __set(string $property, $value) |
|
| 29 | + {
|
|
| 30 | 30 | $this->{$property} = $value; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return null |
| 37 | 37 | */ |
| 38 | - public function __get(string $property) |
|
| 39 | - { |
|
| 40 | - if (property_exists($this, $property)) { |
|
| 38 | + public function __get(string $property) |
|
| 39 | + {
|
|
| 40 | + if (property_exists($this, $property)) {
|
|
| 41 | 41 | return $this->{$property}; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -4,12 +4,12 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace DesignPattern\Creational\Prototype; |
| 6 | 6 | |
| 7 | -class FooPrototype extends Prototype |
|
| 8 | -{ |
|
| 7 | +class FooPrototype extends Prototype |
|
| 8 | +{
|
|
| 9 | 9 | /** |
| 10 | 10 | * Empty clone. |
| 11 | 11 | */ |
| 12 | - public function __clone() |
|
| 13 | - { |
|
| 12 | + public function __clone() |
|
| 13 | + {
|
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Flyweight; |
| 4 | 4 | |
| 5 | -class ExpandBullet extends AbstractBullet |
|
| 6 | -{ |
|
| 5 | +class ExpandBullet extends AbstractBullet |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * Intrinsic state. |
| 9 | 9 | * |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * ExpandBullet constructor. |
| 16 | 16 | */ |
| 17 | - public function __construct() |
|
| 18 | - { |
|
| 17 | + public function __construct() |
|
| 18 | + {
|
|
| 19 | 19 | $this->damage = 100; |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Flyweight; |
| 4 | 4 | |
| 5 | -interface BulletInterface |
|
| 6 | -{ |
|
| 5 | +interface BulletInterface |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * @param int $position |
| 9 | 9 | */ |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace DesignPattern\Structural\Flyweight; |
| 4 | 4 | |
| 5 | -abstract class AbstractBullet implements BulletInterface |
|
| 6 | -{ |
|
| 5 | +abstract class AbstractBullet implements BulletInterface |
|
| 6 | +{
|
|
| 7 | 7 | /** |
| 8 | 8 | * Extrinsic state. |
| 9 | 9 | * |