@@ -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 | } |
@@ -4,34 +4,34 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Email |
| 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 | } |
@@ -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 | } |
@@ -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 | } |