@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\More\EntityAttributeValue; |
6 | 6 | |
7 | -class Attribute |
|
8 | -{ |
|
7 | +class Attribute |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * @var \SplObjectStorage |
11 | 11 | */ |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param string $name |
23 | 23 | */ |
24 | - public function __construct(string $name) |
|
25 | - { |
|
24 | + public function __construct(string $name) |
|
25 | + { |
|
26 | 26 | $this->storage = new \SplObjectStorage(); |
27 | 27 | $this->name = $name; |
28 | 28 | } |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @return string |
50 | 50 | */ |
51 | - public function __toString() |
|
52 | - { |
|
51 | + public function __toString() |
|
52 | + { |
|
53 | 53 | return $this->name; |
54 | 54 | } |
55 | 55 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\More\Delegation; |
6 | 6 | |
7 | -class Component |
|
8 | -{ |
|
7 | +class Component |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * String to array. |
11 | 11 | * |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\More\Delegation; |
6 | 6 | |
7 | -class Controller |
|
8 | -{ |
|
7 | +class Controller |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * @var \DesignPattern\More\Delegation\Component |
11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @param \DesignPattern\More\Delegation\Component $component |
18 | 18 | */ |
19 | - public function __construct(Component $component) |
|
20 | - { |
|
19 | + public function __construct(Component $component) |
|
20 | + { |
|
21 | 21 | $this->component = $component; |
22 | 22 | } |
23 | 23 |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\Creational\SimpleFactory; |
6 | 6 | |
7 | -class Swift implements LanguageInterface |
|
8 | -{ |
|
7 | +class Swift implements LanguageInterface |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * Swift language write application. |
11 | 11 | * |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function create(string $language): LanguageInterface |
35 | 35 | { |
36 | - if (! array_key_exists($language, $this->language)) { |
|
36 | + if ( ! array_key_exists($language, $this->language)) { |
|
37 | 37 | throw new \InvalidArgumentException("$language is not valid programming language."); |
38 | 38 | } |
39 | 39 | $class = $this->language[$language]; |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\Creational\SimpleFactory; |
6 | 6 | |
7 | -class SimpleFactory |
|
8 | -{ |
|
7 | +class SimpleFactory |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * @var array |
11 | 11 | */ |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * SimpleFactory constructor. |
16 | 16 | */ |
17 | - public function __construct() |
|
18 | - { |
|
17 | + public function __construct() |
|
18 | + { |
|
19 | 19 | $this->language = [ |
20 | 20 | 'java' => __NAMESPACE__ . '\\Java', |
21 | 21 | 'swift' => __NAMESPACE__ . '\\Swift', |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function create(string $language): LanguageInterface |
35 | 35 | { |
36 | - if (! array_key_exists($language, $this->language)) { |
|
36 | + if (! array_key_exists($language, $this->language)) { |
|
37 | 37 | throw new \InvalidArgumentException("$language is not valid programming language."); |
38 | 38 | } |
39 | 39 | $class = $this->language[$language]; |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\Creational\SimpleFactory; |
6 | 6 | |
7 | -interface LanguageInterface |
|
8 | -{ |
|
7 | +interface LanguageInterface |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * Write application's language. |
11 | 11 | * |
@@ -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 @@ discard block |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\Creational\FactoryMethod; |
6 | 6 | |
7 | -class MacBookAir implements NotebookInterface |
|
8 | -{ |
|
7 | +class MacBookAir implements NotebookInterface |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * @var string |
11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @param string $color |
18 | 18 | */ |
19 | - public function setColor(string $color) |
|
20 | - { |
|
19 | + public function setColor(string $color) |
|
20 | + { |
|
21 | 21 | $this->color = $color; |
22 | 22 | } |
23 | 23 | } |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | namespace DesignPattern\Creational\FactoryMethod; |
6 | 6 | |
7 | -class MacBook implements NotebookInterface |
|
8 | -{ |
|
7 | +class MacBook implements NotebookInterface |
|
8 | +{ |
|
9 | 9 | /** |
10 | 10 | * @var string |
11 | 11 | */ |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @param string $color |
18 | 18 | */ |
19 | - public function setColor(string $color) |
|
20 | - { |
|
19 | + public function setColor(string $color) |
|
20 | + { |
|
21 | 21 | $this->color = $color; |
22 | 22 | } |
23 | 23 | } |