@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getImages($faker, $type = 'people', $width = 400, $height = 400) |
13 | 13 | { |
14 | - $images = []; |
|
14 | + $images = [ ]; |
|
15 | 15 | $conf = include __DIR__ . "/../../../config/autoload/local.php"; |
16 | - $p = $conf['upload']['public_path']; |
|
16 | + $p = $conf[ 'upload' ][ 'public_path' ]; |
|
17 | 17 | $upload = new Upload($p, ''); |
18 | 18 | |
19 | - for($i = 0; $i < 5; $i++) { |
|
19 | + for ($i = 0; $i < 5; $i++) { |
|
20 | 20 | $filename = md5(rand()) . '.jpg'; |
21 | - $path = $p . $filename[0] . '/' . $filename[1] . '/' . $filename[2] . '/' . $filename; |
|
21 | + $path = $p . $filename[ 0 ] . '/' . $filename[ 1 ] . '/' . $filename[ 2 ] . '/' . $filename; |
|
22 | 22 | $upload->getPath($filename); // create sub folders |
23 | 23 | $img = file_get_contents($faker->imageUrl(400, 400, $type)); |
24 | 24 | file_put_contents($path, $img); |
25 | 25 | |
26 | - $images[] = $upload->getWebPath($filename); |
|
26 | + $images[ ] = $upload->getWebPath($filename); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | return $images; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $faceImages = $this->getImages($faker, 'people'); |
38 | 38 | $profileImages = $this->getImages($faker, 'fashion'); |
39 | 39 | |
40 | - for($i = 0; $i < $count; $i++) { |
|
40 | + for ($i = 0; $i < $count; $i++) { |
|
41 | 41 | $id = $faker->uuid; |
42 | 42 | $mysqluuid = (new MysqlUuid\Uuid($id))->toFormat(new MysqlUuid\Formats\Binary()); |
43 | 43 | |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | 'status' => rand(0, 1), |
52 | 52 | 'last_login' => rand(0, 10) === 7 ? null : $faker->dateTimeBetween('-10 days', 'now')->format('Y-m-d H:i:s'), |
53 | 53 | 'created_at' => $faker->dateTimeBetween('-20 days', '-10 days')->format('Y-m-d H:i:s'), |
54 | - 'face_img' => $faceImages[rand(0, (count($faceImages) - 1))], |
|
55 | - 'profile_img' => $profileImages[rand(0, (count($profileImages) - 1))] |
|
54 | + 'face_img' => $faceImages[ rand(0, (count($faceImages) - 1)) ], |
|
55 | + 'profile_img' => $profileImages[ rand(0, (count($profileImages) - 1)) ] |
|
56 | 56 | ]; |
57 | 57 | |
58 | 58 | $users->insert($data)->save(); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $category = $this->table('category'); |
12 | 12 | $count = rand(5, 10); |
13 | 13 | |
14 | - for($i = 0; $i < $count; $i++) { |
|
14 | + for ($i = 0; $i < $count; $i++) { |
|
15 | 15 | $id = $faker->uuid; |
16 | 16 | $mysqlUuid = (new MysqlUuid\Uuid($id))->toFormat(new MysqlUuid\Formats\Binary()); |
17 | 17 | $categoryName = $faker->name; |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function up() |
10 | 10 | { |
11 | - $this->table('admin_users', ['id' => false, 'primary_key' => 'admin_user_uuid']) |
|
12 | - ->addColumn('admin_user_uuid', 'binary', ['limit' => 16]) |
|
11 | + $this->table('admin_users', [ 'id' => false, 'primary_key' => 'admin_user_uuid' ]) |
|
12 | + ->addColumn('admin_user_uuid', 'binary', [ 'limit' => 16 ]) |
|
13 | 13 | ->addColumn('admin_user_id', 'text') |
14 | 14 | ->addColumn('first_name', 'text') |
15 | 15 | ->addColumn('last_name', 'text') |
16 | - ->addColumn('introduction', 'text', ['null' => true]) |
|
17 | - ->addColumn('biography', 'text', ['null' => true]) |
|
18 | - ->addColumn('email', 'string', ['limit' => 128]) |
|
19 | - ->addColumn('password', 'char', ['limit' => 60]) |
|
20 | - ->addColumn('status', 'integer', ['default' => 0])// 0 => not active, 1 = active |
|
21 | - ->addColumn('face_img', 'text', ['null' => true]) |
|
22 | - ->addColumn('profile_img', 'text', ['null' => true]) |
|
23 | - ->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP']) |
|
24 | - ->addColumn('last_login', 'datetime', ['null' => true]) |
|
25 | - ->addIndex(['email'], ['name' => 'email_INDEX']) |
|
16 | + ->addColumn('introduction', 'text', [ 'null' => true ]) |
|
17 | + ->addColumn('biography', 'text', [ 'null' => true ]) |
|
18 | + ->addColumn('email', 'string', [ 'limit' => 128 ]) |
|
19 | + ->addColumn('password', 'char', [ 'limit' => 60 ]) |
|
20 | + ->addColumn('status', 'integer', [ 'default' => 0 ])// 0 => not active, 1 = active |
|
21 | + ->addColumn('face_img', 'text', [ 'null' => true ]) |
|
22 | + ->addColumn('profile_img', 'text', [ 'null' => true ]) |
|
23 | + ->addColumn('created_at', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
24 | + ->addColumn('last_login', 'datetime', [ 'null' => true ]) |
|
25 | + ->addIndex([ 'email' ], [ 'name' => 'email_INDEX' ]) |
|
26 | 26 | ->create(); |
27 | 27 | |
28 | 28 | // Insert one default admin user with password testtest |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | private function getImage($faker, $type = 'people', $width = 400, $height = 400) |
52 | 52 | { |
53 | 53 | $conf = include __DIR__ . "/../../../config/autoload/local.php"; |
54 | - $p = $conf['upload']['public_path']; |
|
54 | + $p = $conf[ 'upload' ][ 'public_path' ]; |
|
55 | 55 | $upload = new \UploadHelper\Upload($p, ''); |
56 | 56 | $filename = md5(rand()) . '.jpg'; |
57 | - $path = $p . $filename[0] . '/' . $filename[1] . '/' . $filename[2] . '/' . $filename; |
|
57 | + $path = $p . $filename[ 0 ] . '/' . $filename[ 1 ] . '/' . $filename[ 2 ] . '/' . $filename; |
|
58 | 58 | $upload->getPath($filename); // create sub folders |
59 | 59 | $img = file_get_contents($faker->imageUrl(400, 400, $type)); |
60 | 60 | file_put_contents($path, $img); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | return [ |
12 | 12 | 'templates' => [ |
13 | 13 | 'paths' => [ |
14 | - 'article' => [__DIR__ . '/../templates/article'], |
|
14 | + 'article' => [ __DIR__ . '/../templates/article' ], |
|
15 | 15 | ], |
16 | 16 | ], |
17 | 17 | |
@@ -51,49 +51,49 @@ discard block |
||
51 | 51 | 'name' => 'admin.posts', |
52 | 52 | 'path' => '/admin/posts', |
53 | 53 | 'middleware' => Controller\PostController::class, |
54 | - 'allowed_methods' => ['GET'], |
|
54 | + 'allowed_methods' => [ 'GET' ], |
|
55 | 55 | ], |
56 | 56 | [ |
57 | 57 | 'name' => 'admin.posts.action', |
58 | 58 | 'path' => '/admin/posts/:action/:id', |
59 | 59 | 'middleware' => Controller\PostController::class, |
60 | - 'allowed_methods' => ['GET', 'POST'], |
|
60 | + 'allowed_methods' => [ 'GET', 'POST' ], |
|
61 | 61 | ], |
62 | 62 | [ |
63 | 63 | 'name' => 'admin.discussions', |
64 | 64 | 'path' => '/admin/discussions', |
65 | 65 | 'middleware' => Controller\DiscussionController::class, |
66 | - 'allowed_methods' => ['GET', 'POST'] |
|
66 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
67 | 67 | ], |
68 | 68 | [ |
69 | 69 | 'name' => 'admin.discussions.action', |
70 | 70 | 'path' => '/admin/discussions/:action/:id', |
71 | 71 | 'middleware' => Controller\DiscussionController::class, |
72 | - 'allowed_methods' => ['GET', 'POST'] |
|
72 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
73 | 73 | ], |
74 | 74 | [ |
75 | 75 | 'name' => 'admin.events', |
76 | 76 | 'path' => '/admin/events', |
77 | 77 | 'middleware' => Controller\EventController::class, |
78 | - 'allowed_methods' => ['GET', 'POST'] |
|
78 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
79 | 79 | ], |
80 | 80 | [ |
81 | 81 | 'name' => 'admin.events.action', |
82 | 82 | 'path' => '/admin/events/:action/:id', |
83 | 83 | 'middleware' => Controller\EventController::class, |
84 | - 'allowed_methods' => ['GET', 'POST'] |
|
84 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
85 | 85 | ], |
86 | 86 | [ |
87 | 87 | 'name' => 'admin.videos', |
88 | 88 | 'path' => '/admin/videos', |
89 | 89 | 'middleware' => Controller\VideoController::class, |
90 | - 'allowed_methods' => ['GET', 'POST'] |
|
90 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
91 | 91 | ], |
92 | 92 | [ |
93 | 93 | 'name' => 'admin.videos.action', |
94 | 94 | 'path' => '/admin/videos/:action/:id', |
95 | 95 | 'middleware' => Controller\VideoController::class, |
96 | - 'allowed_methods' => ['GET', 'POST'] |
|
96 | + 'allowed_methods' => [ 'GET', 'POST' ] |
|
97 | 97 | ] |
98 | 98 | ], |
99 | 99 |
@@ -19,8 +19,8 @@ |
||
19 | 19 | */ |
20 | 20 | public function __invoke(ContainerInterface $container) |
21 | 21 | { |
22 | - $config = $container->get('config')['upload']; |
|
23 | - $upload = new Upload($config['public_path'], $config['non_public_path']); |
|
22 | + $config = $container->get('config')[ 'upload' ]; |
|
23 | + $upload = new Upload($config[ 'public_path' ], $config[ 'non_public_path' ]); |
|
24 | 24 | |
25 | 25 | return new EventService( |
26 | 26 | $container->get(ArticleMapper::class), |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace Article\Factory\Controller; |
5 | 5 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Newsletter\Service; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Newsletter\Mapper; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Newsletter\Web\Action; |
6 | 6 |