@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * @param string $string |
34 | 34 | * |
35 | - * @return string |
|
35 | + * @return Uuid |
|
36 | 36 | */ |
37 | 37 | public static function fromString(string $string): string |
38 | 38 | { |
@@ -6,52 +6,52 @@ |
||
6 | 6 | |
7 | 7 | class Uuid |
8 | 8 | { |
9 | - /** |
|
10 | - * @var string |
|
11 | - */ |
|
12 | - private $value; |
|
13 | - |
|
14 | - /** |
|
15 | - * Uuid constructor. |
|
16 | - * |
|
17 | - * @param string $value |
|
18 | - */ |
|
19 | - protected function __construct(string $value = null) |
|
20 | - { |
|
21 | - $this->value = is_null($value) ? self::generate() : $value; |
|
22 | - } |
|
23 | - |
|
24 | - /** |
|
25 | - * @return static |
|
26 | - */ |
|
27 | - public static function generate(): string |
|
28 | - { |
|
29 | - return new static(UuidRamsey::uuid4()->toString()); |
|
30 | - } |
|
31 | - |
|
32 | - /** |
|
33 | - * @param string $string |
|
34 | - * |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - public static function fromString(string $string): string |
|
38 | - { |
|
39 | - return new static($string); |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * @return string |
|
44 | - */ |
|
45 | - public function getValue(): string |
|
46 | - { |
|
47 | - return $this->value; |
|
48 | - } |
|
49 | - |
|
50 | - /** |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - public function __toString() |
|
54 | - { |
|
55 | - return $this->getValue(); |
|
56 | - } |
|
9 | + /** |
|
10 | + * @var string |
|
11 | + */ |
|
12 | + private $value; |
|
13 | + |
|
14 | + /** |
|
15 | + * Uuid constructor. |
|
16 | + * |
|
17 | + * @param string $value |
|
18 | + */ |
|
19 | + protected function __construct(string $value = null) |
|
20 | + { |
|
21 | + $this->value = is_null($value) ? self::generate() : $value; |
|
22 | + } |
|
23 | + |
|
24 | + /** |
|
25 | + * @return static |
|
26 | + */ |
|
27 | + public static function generate(): string |
|
28 | + { |
|
29 | + return new static(UuidRamsey::uuid4()->toString()); |
|
30 | + } |
|
31 | + |
|
32 | + /** |
|
33 | + * @param string $string |
|
34 | + * |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + public static function fromString(string $string): string |
|
38 | + { |
|
39 | + return new static($string); |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * @return string |
|
44 | + */ |
|
45 | + public function getValue(): string |
|
46 | + { |
|
47 | + return $this->value; |
|
48 | + } |
|
49 | + |
|
50 | + /** |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + public function __toString() |
|
54 | + { |
|
55 | + return $this->getValue(); |
|
56 | + } |
|
57 | 57 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function handle(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface |
32 | 32 | { |
33 | - $response = $response->withHeader('Content-Type', 'application/json'); |
|
33 | + $response = $response->withHeader('Content-Type', 'application/json'); |
|
34 | 34 | |
35 | 35 | $this->getContainer()->share(ServerRequestInterface::class, $request); |
36 | 36 | $this->getContainer()->share(ResponseInterface::class, $response); |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | protected function buildMiddlewareStack() |
58 | - { |
|
59 | - $middleware = []; |
|
58 | + { |
|
59 | + $middleware = []; |
|
60 | 60 | |
61 | - foreach ($this->globalMiddleware as $globalMiddleware) { |
|
62 | - $middleware[] = $this->getContainer()->get($globalMiddleware); |
|
63 | - } |
|
61 | + foreach ($this->globalMiddleware as $globalMiddleware) { |
|
62 | + $middleware[] = $this->getContainer()->get($globalMiddleware); |
|
63 | + } |
|
64 | 64 | |
65 | - return $middleware; |
|
66 | - } |
|
65 | + return $middleware; |
|
66 | + } |
|
67 | 67 | } |
68 | 68 |
@@ -21,8 +21,8 @@ |
||
21 | 21 | |
22 | 22 | $this->setContainer($container); |
23 | 23 | |
24 | - $environment = new Dotenv(__DIR__ . '/../api-framework/'); |
|
25 | - $environment->load(); |
|
24 | + $environment = new Dotenv(__DIR__ . '/../api-framework/'); |
|
25 | + $environment->load(); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return null|int The URI port. |
106 | 106 | */ |
107 | - public function getPort(): ?int |
|
107 | + public function getPort(): ? int |
|
108 | 108 | { |
109 | 109 | // TODO: Implement getPort() method. |
110 | 110 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @see https://tools.ietf.org/html/rfc3986#section-3.3 |
135 | 135 | * @return string The URI path. |
136 | 136 | */ |
137 | - public function getPath(): string |
|
137 | + public function getPath() : string |
|
138 | 138 | { |
139 | 139 | // TODO: Implement getPath() method. |
140 | 140 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @see https://tools.ietf.org/html/rfc3986#section-3.4 |
160 | 160 | * @return string The URI query string. |
161 | 161 | */ |
162 | - public function getQuery(): string |
|
162 | + public function getQuery() : string |
|
163 | 163 | { |
164 | 164 | // TODO: Implement getQuery() method. |
165 | 165 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @see https://tools.ietf.org/html/rfc3986#section-3.5 |
181 | 181 | * @return string The URI fragment. |
182 | 182 | */ |
183 | - public function getFragment(): string |
|
183 | + public function getFragment() : string |
|
184 | 184 | { |
185 | 185 | // TODO: Implement getFragment() method. |
186 | 186 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * @see http://tools.ietf.org/html/rfc3986#section-4.1 |
360 | 360 | * @return string |
361 | 361 | */ |
362 | - public function __toString(): string |
|
362 | + public function __toString() : string |
|
363 | 363 | { |
364 | 364 | // TODO: Implement __toString() method. |
365 | 365 | }} |
@@ -4,34 +4,34 @@ |
||
4 | 4 | |
5 | 5 | class Url |
6 | 6 | { |
7 | - /** |
|
8 | - * @var string |
|
9 | - */ |
|
10 | - private $value; |
|
7 | + /** |
|
8 | + * @var string |
|
9 | + */ |
|
10 | + private $value; |
|
11 | 11 | |
12 | - /** |
|
13 | - * Email constructor. |
|
14 | - * |
|
15 | - * @param string $value |
|
16 | - */ |
|
17 | - protected function __construct(string $value) |
|
18 | - { |
|
19 | - $this->value = $value; |
|
20 | - } |
|
12 | + /** |
|
13 | + * Email constructor. |
|
14 | + * |
|
15 | + * @param string $value |
|
16 | + */ |
|
17 | + protected function __construct(string $value) |
|
18 | + { |
|
19 | + $this->value = $value; |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public function getValue(): string |
|
26 | - { |
|
27 | - return $this->value; |
|
28 | - } |
|
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public function getValue(): string |
|
26 | + { |
|
27 | + return $this->value; |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - public function __toString(): string |
|
34 | - { |
|
35 | - return $this->getValue(); |
|
36 | - } |
|
30 | + /** |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + public function __toString(): string |
|
34 | + { |
|
35 | + return $this->getValue(); |
|
36 | + } |
|
37 | 37 | } |
@@ -7,5 +7,5 @@ |
||
7 | 7 | |
8 | 8 | interface Repository |
9 | 9 | { |
10 | - public function findByUuid(Uuid $uuid): Model; |
|
10 | + public function findByUuid(Uuid $uuid): Model; |
|
11 | 11 | } |
12 | 12 | \ No newline at end of file |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | class MySQLRepository implements Repository |
10 | 10 | { |
11 | - public function findByUuid(Uuid $uuid): Model |
|
12 | - { |
|
13 | - // TODO: Implement findByUuid() method. |
|
14 | - } |
|
11 | + public function findByUuid(Uuid $uuid): Model |
|
12 | + { |
|
13 | + // TODO: Implement findByUuid() method. |
|
14 | + } |
|
15 | 15 | } |
@@ -4,34 +4,34 @@ |
||
4 | 4 | |
5 | 5 | class Url |
6 | 6 | { |
7 | - /** |
|
8 | - * @var string |
|
9 | - */ |
|
10 | - private $value; |
|
7 | + /** |
|
8 | + * @var string |
|
9 | + */ |
|
10 | + private $value; |
|
11 | 11 | |
12 | - /** |
|
13 | - * Email constructor. |
|
14 | - * |
|
15 | - * @param string $value |
|
16 | - */ |
|
17 | - protected function __construct(string $value) |
|
18 | - { |
|
19 | - $this->value = $value; |
|
20 | - } |
|
12 | + /** |
|
13 | + * Email constructor. |
|
14 | + * |
|
15 | + * @param string $value |
|
16 | + */ |
|
17 | + protected function __construct(string $value) |
|
18 | + { |
|
19 | + $this->value = $value; |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public function getValue(): string |
|
26 | - { |
|
27 | - return $this->value; |
|
28 | - } |
|
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public function getValue(): string |
|
26 | + { |
|
27 | + return $this->value; |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - public function __toString(): string |
|
34 | - { |
|
35 | - return $this->getValue(); |
|
36 | - } |
|
30 | + /** |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + public function __toString(): string |
|
34 | + { |
|
35 | + return $this->getValue(); |
|
36 | + } |
|
37 | 37 | } |