@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Category\Controller; |
6 | 6 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | public function index(): \Psr\Http\Message\ResponseInterface |
54 | 54 | { |
55 | 55 | $params = $this->request->getQueryParams(); |
56 | - $page = isset($params['page']) ? $params['page'] : 1; |
|
57 | - $limit = isset($params['limit']) ? $params['limit'] : 15; |
|
56 | + $page = isset($params[ 'page' ]) ? $params[ 'page' ] : 1; |
|
57 | + $limit = isset($params[ 'limit' ]) ? $params[ 'limit' ] : 15; |
|
58 | 58 | |
59 | 59 | $categories = $this->categoryService->getPagination($page, $limit); |
60 | 60 | |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return \Psr\Http\Message\ResponseInterface |
71 | 71 | */ |
72 | - public function edit($errors = []): \Psr\Http\Message\ResponseInterface |
|
72 | + public function edit($errors = [ ]): \Psr\Http\Message\ResponseInterface |
|
73 | 73 | { |
74 | 74 | $id = $this->request->getAttribute('id'); |
75 | 75 | $category = $this->categoryService->getCategory($id); |
76 | 76 | |
77 | 77 | if ($this->request->getParsedBody()) { |
78 | - $category = (object)($this->request->getParsedBody() + (array)$category); |
|
78 | + $category = (object) ($this->request->getParsedBody() + (array) $category); |
|
79 | 79 | $category->category_id = $id; |
80 | 80 | } |
81 | 81 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Category\View\Helper; |
5 | 5 |
@@ -6,21 +6,21 @@ |
||
6 | 6 | { |
7 | 7 | public function up() |
8 | 8 | { |
9 | - $this->table('articles', ['id' => false, 'primary_key' => 'article_uuid']) |
|
10 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
9 | + $this->table('articles', [ 'id' => false, 'primary_key' => 'article_uuid' ]) |
|
10 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
11 | 11 | ->addColumn('article_id', 'text') |
12 | - ->addColumn('slug', 'text', ['null' => true]) |
|
13 | - ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
14 | - ->addColumn('published_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
12 | + ->addColumn('slug', 'text', [ 'null' => true ]) |
|
13 | + ->addColumn('created_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
14 | + ->addColumn('published_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
15 | 15 | ->addColumn('type', 'integer') // see Article\Entity\ArticleType |
16 | 16 | ->addColumn('status', 'integer') // active, not active, ... |
17 | - ->addColumn('admin_user_uuid', 'binary', ['limit' => 16]) |
|
18 | - ->addColumn('is_wysiwyg_editor', 'boolean', ['default' => false]) |
|
19 | - ->addColumn('category_uuid', 'binary', ['limit' => 16]) |
|
20 | - ->addForeignKey('category_uuid', 'category', 'category_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
21 | - ->addForeignKey('admin_user_uuid', 'admin_users', 'admin_user_uuid', ['delete' => 'NO_ACTION', 'update' => 'NO_ACTION']) |
|
22 | - ->addIndex('type', ['name' => 'type_INDEX']) |
|
23 | - ->addIndex('published_at', ['name' => 'published_at_INDEX']) |
|
17 | + ->addColumn('admin_user_uuid', 'binary', [ 'limit' => 16 ]) |
|
18 | + ->addColumn('is_wysiwyg_editor', 'boolean', [ 'default' => false ]) |
|
19 | + ->addColumn('category_uuid', 'binary', [ 'limit' => 16 ]) |
|
20 | + ->addForeignKey('category_uuid', 'category', 'category_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
21 | + ->addForeignKey('admin_user_uuid', 'admin_users', 'admin_user_uuid', [ 'delete' => 'NO_ACTION', 'update' => 'NO_ACTION' ]) |
|
22 | + ->addIndex('type', [ 'name' => 'type_INDEX' ]) |
|
23 | + ->addIndex('published_at', [ 'name' => 'published_at_INDEX' ]) |
|
24 | 24 | ->create(); |
25 | 25 | } |
26 | 26 |
@@ -9,17 +9,17 @@ |
||
9 | 9 | |
10 | 10 | public function up() |
11 | 11 | { |
12 | - $this->table('category', ['id' => false, 'primary_key' => 'category_uuid']) |
|
13 | - ->addColumn('category_uuid', 'binary', ['limit' => 16]) |
|
12 | + $this->table('category', [ 'id' => false, 'primary_key' => 'category_uuid' ]) |
|
13 | + ->addColumn('category_uuid', 'binary', [ 'limit' => 16 ]) |
|
14 | 14 | ->addColumn('category_id', 'text') |
15 | 15 | ->addColumn('name', 'text') |
16 | 16 | ->addColumn('slug', 'text') |
17 | 17 | ->addColumn('type', 'integer') // see Article\Entity\ArticleType |
18 | - ->addColumn('title', 'text', ['null' => true]) |
|
19 | - ->addColumn('description', 'text', ['null' => true]) |
|
20 | - ->addColumn('main_img', 'text', ['null' => true]) |
|
21 | - ->addColumn('is_in_homepage', 'boolean', ['default' => false]) |
|
22 | - ->addColumn('is_in_category_list', 'boolean', ['default' => true]) |
|
18 | + ->addColumn('title', 'text', [ 'null' => true ]) |
|
19 | + ->addColumn('description', 'text', [ 'null' => true ]) |
|
20 | + ->addColumn('main_img', 'text', [ 'null' => true ]) |
|
21 | + ->addColumn('is_in_homepage', 'boolean', [ 'default' => false ]) |
|
22 | + ->addColumn('is_in_category_list', 'boolean', [ 'default' => true ]) |
|
23 | 23 | ->create(); |
24 | 24 | } |
25 | 25 |