@@ -48,11 +48,11 @@ |
||
48 | 48 | '/docs', |
49 | 49 | [ |
50 | 50 | Route::get('') |
51 | - ->addMiddleware(fn (SwaggerUi $swaggerUi) => $swaggerUi->withJsonUrl('/docs/openapi.json')) |
|
51 | + ->addMiddleware(fn(SwaggerUi $swaggerUi) => $swaggerUi->withJsonUrl('/docs/openapi.json')) |
|
52 | 52 | ->addMiddleware(FormatDataResponseAsHtml::class), |
53 | 53 | Route::get('/openapi.json') |
54 | 54 | ->addMiddleware( |
55 | - static function (SwaggerJson $swaggerJson) { |
|
55 | + static function(SwaggerJson $swaggerJson) { |
|
56 | 56 | return $swaggerJson |
57 | 57 | // Uncomment cache for production environment |
58 | 58 | // ->withCache(3600) |
@@ -12,7 +12,7 @@ |
||
12 | 12 | use Yiisoft\Router\RouteCollectorInterface; |
13 | 13 | |
14 | 14 | return [ |
15 | - RouteCollectionInterface::class => static function (RouteCollectorInterface $collector) { |
|
15 | + RouteCollectionInterface::class => static function(RouteCollectorInterface $collector) { |
|
16 | 16 | $collector->addGroup( |
17 | 17 | Group::create(null, require Builder::path('routes')) |
18 | 18 | ->addMiddleware(ExceptionMiddleware::class) |
@@ -13,7 +13,7 @@ |
||
13 | 13 | return [ |
14 | 14 | Yiisoft\Yii\Web\Application::class => [ |
15 | 15 | '__construct()' => [ |
16 | - 'dispatcher' => static function (Injector $injector) { |
|
16 | + 'dispatcher' => static function(Injector $injector) { |
|
17 | 17 | return ($injector->make(MiddlewareDispatcher::class)) |
18 | 18 | ->withMiddlewares( |
19 | 19 | [ |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // PHP built-in server routing. |
14 | 14 | if (PHP_SAPI === 'cli-server') { |
15 | 15 | // Serve static files as is. |
16 | - if (is_file(__DIR__ . $_SERVER["REQUEST_URI"])) { |
|
16 | + if (is_file(__DIR__.$_SERVER["REQUEST_URI"])) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $_SERVER['SCRIPT_NAME'] = '/index.php'; |
22 | 22 | } |
23 | 23 | |
24 | -require_once dirname(__DIR__) . '/vendor/autoload.php'; |
|
24 | +require_once dirname(__DIR__).'/vendor/autoload.php'; |
|
25 | 25 | |
26 | 26 | // Don't do it in production, assembling takes it's time |
27 | -$configTime = FileHelper::lastModifiedTime(dirname(__DIR__) . '/config/'); |
|
28 | -$buildTime = FileHelper::lastModifiedTime(dirname(__DIR__) . '/runtime/build/config/'); |
|
27 | +$configTime = FileHelper::lastModifiedTime(dirname(__DIR__).'/config/'); |
|
28 | +$buildTime = FileHelper::lastModifiedTime(dirname(__DIR__).'/runtime/build/config/'); |
|
29 | 29 | if ($buildTime < $configTime) { |
30 | 30 | Builder::rebuild(); |
31 | 31 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | // PHP built-in server routing. |
13 | 13 | if (PHP_SAPI === 'cli-server') { |
14 | 14 | // Serve static files as is. |
15 | - if (is_file(__DIR__ . $_SERVER["REQUEST_URI"])) { |
|
15 | + if (is_file(__DIR__.$_SERVER["REQUEST_URI"])) { |
|
16 | 16 | return false; |
17 | 17 | } |
18 | 18 | |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | $_SERVER['SCRIPT_NAME'] = '/index-test.php'; |
21 | 21 | } |
22 | 22 | |
23 | -$c3 = dirname(__DIR__) . '/c3.php'; |
|
23 | +$c3 = dirname(__DIR__).'/c3.php'; |
|
24 | 24 | |
25 | 25 | if (is_file($c3)) { |
26 | 26 | require_once $c3; |
27 | 27 | } |
28 | 28 | |
29 | -require_once dirname(__DIR__) . '/vendor/autoload.php'; |
|
29 | +require_once dirname(__DIR__).'/vendor/autoload.php'; |
|
30 | 30 | |
31 | 31 | Builder::rebuild(); |
32 | 32 |
@@ -10,6 +10,6 @@ |
||
10 | 10 | { |
11 | 11 | public function getId(): int |
12 | 12 | { |
13 | - return (int)$this->getAttributeValue('attributes.id'); |
|
13 | + return (int) $this->getAttributeValue('attributes.id'); |
|
14 | 14 | } |
15 | 15 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function getPage(): int |
26 | 26 | { |
27 | 27 | if ($this->hasAttribute('query.page')) { |
28 | - return (int)$this->getAttributeValue('query.page'); |
|
28 | + return (int) $this->getAttributeValue('query.page'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return self::DEFAULT_PAGE_PARAM; |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | { |
24 | 24 | public function getId(): int |
25 | 25 | { |
26 | - return (int)$this->getAttributeValue('attributes.id'); |
|
26 | + return (int) $this->getAttributeValue('attributes.id'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function getTitle(): string |
30 | 30 | { |
31 | - return (string)$this->getAttributeValue('body.title'); |
|
31 | + return (string) $this->getAttributeValue('body.title'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function getText(): string |
35 | 35 | { |
36 | - return (string)$this->getAttributeValue('body.text'); |
|
36 | + return (string) $this->getAttributeValue('body.text'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function getStatus(): PostStatus |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ], |
59 | 59 | 'body.status' => [ |
60 | 60 | new Required(), |
61 | - static function ($value): Result { |
|
61 | + static function($value): Result { |
|
62 | 62 | $result = new Result(); |
63 | 63 | if (!PostStatus::isValid($value)) { |
64 | 64 | $result->addError('Incorrect status'); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | public function getId(): ?string |
67 | 67 | { |
68 | - return $this->id === null ? null : (string)$this->id; |
|
68 | + return $this->id === null ? null : (string) $this->id; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getToken(): string |