@@ -54,15 +54,13 @@ discard block |
||
54 | 54 | * class ServerCommand |
55 | 55 | * @package Platine\Framework\Console\Command |
56 | 56 | */ |
57 | -class ServerCommand extends Command |
|
58 | -{ |
|
57 | +class ServerCommand extends Command { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * Create new instance |
62 | 61 | * {@inheritodc} |
63 | 62 | */ |
64 | - public function __construct() |
|
65 | - { |
|
63 | + public function __construct() { |
|
66 | 64 | parent::__construct('server', 'Command to manage PHP development server'); |
67 | 65 | $this->addOption('-a|--address', 'Server address', '0.0.0.0', true); |
68 | 66 | $this->addOption('-p|--port', 'Server listen port', '8080', true); |
@@ -72,8 +70,7 @@ discard block |
||
72 | 70 | /** |
73 | 71 | * {@inheritodc} |
74 | 72 | */ |
75 | - public function execute() |
|
76 | - { |
|
73 | + public function execute() { |
|
77 | 74 | $host = $this->getOptionValue('address'); |
78 | 75 | $port = $this->getOptionValue('port'); |
79 | 76 | $path = $this->getOptionValue('root'); |
@@ -3,6 +3,6 @@ |
||
3 | 3 | use Platine\Framework\Demo\Action\HomeAction; |
4 | 4 | use Platine\Route\Router; |
5 | 5 | |
6 | -return [static function (Router $router): void { |
|
6 | +return [static function(Router $router): void { |
|
7 | 7 | $router->get('/', HomeAction::class, 'home'); |
8 | 8 | }]; |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddPermissionsTable20210717094547 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddPermissionsTable20210717094547 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('permissions', function (CreateTable $table) { |
|
14 | + $this->create('permissions', function(CreateTable $table) { |
|
15 | 15 | $table->integer('id') |
16 | 16 | ->autoincrement() |
17 | 17 | ->primary(); |
@@ -10,25 +10,25 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('permissions', function (CreateTable $table) { |
15 | 15 | $table->integer('id') |
16 | - ->autoincrement() |
|
17 | - ->primary(); |
|
16 | + ->autoincrement() |
|
17 | + ->primary(); |
|
18 | 18 | $table->string('code') |
19 | - ->description('The permission code') |
|
20 | - ->unique() |
|
21 | - ->notNull(); |
|
19 | + ->description('The permission code') |
|
20 | + ->unique() |
|
21 | + ->notNull(); |
|
22 | 22 | $table->string('description') |
23 | - ->description('The permission description') |
|
24 | - ->notNull(); |
|
23 | + ->description('The permission description') |
|
24 | + ->notNull(); |
|
25 | 25 | $table->string('depend') |
26 | - ->description('The permission dependency'); |
|
26 | + ->description('The permission dependency'); |
|
27 | 27 | $table->datetime('created_at') |
28 | - ->description('permission created at') |
|
29 | - ->notNull(); |
|
28 | + ->description('permission created at') |
|
29 | + ->notNull(); |
|
30 | 30 | $table->datetime('updated_at') |
31 | - ->description('permission updated at'); |
|
31 | + ->description('permission updated at'); |
|
32 | 32 | |
33 | 33 | $table->engine('INNODB'); |
34 | 34 | }); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function down(): void |
38 | 38 | { |
39 | - //Action when migrate down |
|
39 | + //Action when migrate down |
|
40 | 40 | $this->drop('permissions'); |
41 | 41 | } |
42 | 42 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddUsersTable20210705065248 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddUsersTable20210705065248 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -10,47 +10,47 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('users', function (CreateTable $table) { |
15 | 15 | $table->integer('id') |
16 | - ->autoincrement() |
|
17 | - ->primary(); |
|
16 | + ->autoincrement() |
|
17 | + ->primary(); |
|
18 | 18 | |
19 | 19 | $table->string('username') |
20 | - ->description('The user username') |
|
21 | - ->unique() |
|
22 | - ->notNull(); |
|
20 | + ->description('The user username') |
|
21 | + ->unique() |
|
22 | + ->notNull(); |
|
23 | 23 | |
24 | 24 | $table->string('email') |
25 | - ->description('The user email') |
|
26 | - ->unique() |
|
27 | - ->notNull(); |
|
25 | + ->description('The user email') |
|
26 | + ->unique() |
|
27 | + ->notNull(); |
|
28 | 28 | |
29 | 29 | $table->string('password') |
30 | - ->description('The user password') |
|
31 | - ->notNull(); |
|
30 | + ->description('The user password') |
|
31 | + ->notNull(); |
|
32 | 32 | |
33 | 33 | $table->integer('status') |
34 | - ->size('tiny') |
|
35 | - ->description('The user status') |
|
36 | - ->defaultValue(0); |
|
34 | + ->size('tiny') |
|
35 | + ->description('The user status') |
|
36 | + ->defaultValue(0); |
|
37 | 37 | |
38 | 38 | $table->integer('age') |
39 | - ->size('tiny') |
|
40 | - ->description('The user age'); |
|
39 | + ->size('tiny') |
|
40 | + ->description('The user age'); |
|
41 | 41 | |
42 | 42 | $table->string('lastname') |
43 | - ->description('The user lastname'); |
|
43 | + ->description('The user lastname'); |
|
44 | 44 | |
45 | 45 | $table->string('firstname') |
46 | - ->description('The user firstname'); |
|
46 | + ->description('The user firstname'); |
|
47 | 47 | |
48 | 48 | $table->datetime('created_at') |
49 | - ->description('created date') |
|
50 | - ->notNull(); |
|
49 | + ->description('created date') |
|
50 | + ->notNull(); |
|
51 | 51 | |
52 | 52 | $table->datetime('updated_at') |
53 | - ->description('last updated date'); |
|
53 | + ->description('last updated date'); |
|
54 | 54 | |
55 | 55 | $table->engine('INNODB'); |
56 | 56 | }); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function down(): void |
60 | 60 | { |
61 | - //Action when migrate down |
|
61 | + //Action when migrate down |
|
62 | 62 | $this->drop('users'); |
63 | 63 | } |
64 | 64 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('users', function (CreateTable $table) { |
|
14 | + $this->create('users', function(CreateTable $table) { |
|
15 | 15 | $table->integer('id') |
16 | 16 | ->autoincrement() |
17 | 17 | ->primary(); |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddPermissionRolesTable20210717094822 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddPermissionRolesTable20210717094822 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('permissions_roles', function (CreateTable $table) { |
15 | 15 | $table->integer('permission_id'); |
16 | 16 | $table->integer('role_id'); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $table->primary(['permission_id', 'role_id']); |
19 | 19 | |
20 | 20 | $table->foreign('permission_id') |
21 | - ->references('permissions', 'id') |
|
22 | - ->onDelete('CASCADE'); |
|
21 | + ->references('permissions', 'id') |
|
22 | + ->onDelete('CASCADE'); |
|
23 | 23 | |
24 | 24 | $table->foreign('role_id') |
25 | - ->references('roles', 'id') |
|
26 | - ->onDelete('CASCADE'); |
|
25 | + ->references('roles', 'id') |
|
26 | + ->onDelete('CASCADE'); |
|
27 | 27 | |
28 | 28 | $table->engine('INNODB'); |
29 | 29 | }); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function down(): void |
33 | 33 | { |
34 | - //Action when migrate down |
|
34 | + //Action when migrate down |
|
35 | 35 | $this->drop('permissions_roles'); |
36 | 36 | } |
37 | 37 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('permissions_roles', function (CreateTable $table) { |
|
14 | + $this->create('permissions_roles', function(CreateTable $table) { |
|
15 | 15 | $table->integer('permission_id'); |
16 | 16 | $table->integer('role_id'); |
17 | 17 |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddRoleUsersTable20210717100434 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddRoleUsersTable20210717100434 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('roles_users', function (CreateTable $table) { |
15 | 15 | $table->integer('user_id'); |
16 | 16 | $table->integer('role_id'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function down(): void |
33 | 33 | { |
34 | - //Action when migrate down |
|
34 | + //Action when migrate down |
|
35 | 35 | $this->drop('roles_users'); |
36 | 36 | } |
37 | 37 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('roles_users', function (CreateTable $table) { |
|
14 | + $this->create('roles_users', function(CreateTable $table) { |
|
15 | 15 | $table->integer('user_id'); |
16 | 16 | $table->integer('role_id'); |
17 | 17 |
@@ -62,8 +62,7 @@ |
||
62 | 62 | * @package Platine\Framework\Auth\Middleware |
63 | 63 | * @template T |
64 | 64 | */ |
65 | -class AuthorizationMiddleware implements MiddlewareInterface |
|
66 | -{ |
|
65 | +class AuthorizationMiddleware implements MiddlewareInterface { |
|
67 | 66 | |
68 | 67 | /** |
69 | 68 | * The Authorization instance |
@@ -62,8 +62,7 @@ |
||
62 | 62 | * @package Platine\Framework\Auth\Middleware |
63 | 63 | * @template T |
64 | 64 | */ |
65 | -class AuthenticationMiddleware implements MiddlewareInterface |
|
66 | -{ |
|
65 | +class AuthenticationMiddleware implements MiddlewareInterface { |
|
67 | 66 | |
68 | 67 | /** |
69 | 68 | * The Authentication instance |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class InvalidCredentialsException |
38 | 38 | * @package Platine\Framework\Auth\Exception |
39 | 39 | */ |
40 | -class InvalidCredentialsException extends AuthenticationException |
|
41 | -{ |
|
40 | +class InvalidCredentialsException extends AuthenticationException { |
|
42 | 41 | } |