@@ -27,8 +27,8 @@ |
||
| 27 | 27 | protected string $value; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * {@inheritdoc} |
|
| 31 | - */ |
|
| 30 | + * {@inheritdoc} |
|
| 31 | + */ |
|
| 32 | 32 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 33 | 33 | { |
| 34 | 34 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | public function setRules(): void |
| 33 | 33 | { |
| 34 | 34 | $this->validator->addRules('username', [ |
| 35 | - new NotEmpty(), |
|
| 36 | - new MinLength(3) |
|
| 35 | + new NotEmpty(), |
|
| 36 | + new MinLength(3) |
|
| 37 | 37 | ]); |
| 38 | 38 | |
| 39 | 39 | $this->validator->addRules('password', [ |
| 40 | - new NotEmpty(), |
|
| 40 | + new NotEmpty(), |
|
| 41 | 41 | ]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $this->template, |
| 80 | 80 | 'user/create', |
| 81 | 81 | [ |
| 82 | - 'param' => $formParam |
|
| 82 | + 'param' => $formParam |
|
| 83 | 83 | ] |
| 84 | 84 | ); |
| 85 | 85 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $this->template, |
| 108 | 108 | 'user/create', |
| 109 | 109 | [ |
| 110 | - 'param' => $formParam |
|
| 110 | + 'param' => $formParam |
|
| 111 | 111 | ] |
| 112 | 112 | ); |
| 113 | 113 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->template, |
| 88 | 88 | 'user/edit', |
| 89 | 89 | [ |
| 90 | - 'param' => $formParam |
|
| 90 | + 'param' => $formParam |
|
| 91 | 91 | ] |
| 92 | 92 | ); |
| 93 | 93 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $this->template, |
| 114 | 114 | 'user/edit', |
| 115 | 115 | [ |
| 116 | - 'param' => $formParam |
|
| 116 | + 'param' => $formParam |
|
| 117 | 117 | ] |
| 118 | 118 | ); |
| 119 | 119 | } |
@@ -39,30 +39,30 @@ |
||
| 39 | 39 | public function setRules(): void |
| 40 | 40 | { |
| 41 | 41 | $this->validator->addRules('username', [ |
| 42 | - new NotEmpty(), |
|
| 43 | - new MinLength(3), |
|
| 42 | + new NotEmpty(), |
|
| 43 | + new MinLength(3), |
|
| 44 | 44 | new AlphaDash() |
| 45 | 45 | ]); |
| 46 | 46 | |
| 47 | 47 | $this->validator->addRules('lastname', [ |
| 48 | - new NotEmpty(), |
|
| 49 | - new MinLength(3) |
|
| 48 | + new NotEmpty(), |
|
| 49 | + new MinLength(3) |
|
| 50 | 50 | ]); |
| 51 | 51 | |
| 52 | 52 | $this->validator->addRules('firstname', [ |
| 53 | - new NotEmpty(), |
|
| 54 | - new MinLength(3) |
|
| 53 | + new NotEmpty(), |
|
| 54 | + new MinLength(3) |
|
| 55 | 55 | ]); |
| 56 | 56 | |
| 57 | 57 | $this->validator->addRules('age', [ |
| 58 | - new NotEmpty(), |
|
| 59 | - new Number(), |
|
| 60 | - new Min(0), |
|
| 61 | - new Max(100), |
|
| 58 | + new NotEmpty(), |
|
| 59 | + new Number(), |
|
| 60 | + new Min(0), |
|
| 61 | + new Max(100), |
|
| 62 | 62 | ]); |
| 63 | 63 | |
| 64 | 64 | $this->validator->addRules('password', [ |
| 65 | - new MinLength(5), |
|
| 65 | + new MinLength(5), |
|
| 66 | 66 | ]); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -9,26 +9,26 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->create('roles', function (CreateTable $table) { |
|
| 14 | - $table->integer('id') |
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 17 | - $table->string('description') |
|
| 18 | - ->description('The role description'); |
|
| 19 | - $table->datetime('created_at') |
|
| 20 | - ->description('role created at') |
|
| 21 | - ->notNull(); |
|
| 22 | - $table->datetime('updated_at') |
|
| 23 | - ->description('role updated at'); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->create('roles', function (CreateTable $table) { |
|
| 14 | + $table->integer('id') |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | + $table->string('description') |
|
| 18 | + ->description('The role description'); |
|
| 19 | + $table->datetime('created_at') |
|
| 20 | + ->description('role created at') |
|
| 21 | + ->notNull(); |
|
| 22 | + $table->datetime('updated_at') |
|
| 23 | + ->description('role updated at'); |
|
| 24 | 24 | |
| 25 | - $table->engine('INNODB'); |
|
| 26 | - }); |
|
| 25 | + $table->engine('INNODB'); |
|
| 26 | + }); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function down(): void |
| 30 | 30 | { |
| 31 | - //Action when migrate down |
|
| 32 | - $this->drop('roles'); |
|
| 31 | + //Action when migrate down |
|
| 32 | + $this->drop('roles'); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -9,18 +9,18 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->alter('roles', function (AlterTable $table) { |
|
| 14 | - $table->string('code')->notNull(); |
|
| 15 | - $table->unique('code'); |
|
| 16 | - }); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->alter('roles', function (AlterTable $table) { |
|
| 14 | + $table->string('code')->notNull(); |
|
| 15 | + $table->unique('code'); |
|
| 16 | + }); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function down(): void |
| 20 | 20 | { |
| 21 | - //Action when migrate down |
|
| 22 | - $this->alter('roles', function (AlterTable $table) { |
|
| 23 | - $table->dropColumn('code'); |
|
| 24 | - }); |
|
| 21 | + //Action when migrate down |
|
| 22 | + $this->alter('roles', function (AlterTable $table) { |
|
| 23 | + $table->dropColumn('code'); |
|
| 24 | + }); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -9,44 +9,44 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->create('config', function (CreateTable $table) { |
|
| 14 | - $table->integer('id') |
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 17 | - $table->string('env') |
|
| 18 | - ->description('The config environment') |
|
| 19 | - ->index(); |
|
| 20 | - $table->string('module') |
|
| 21 | - ->description('The module') |
|
| 22 | - ->index(); |
|
| 23 | - $table->string('code') |
|
| 24 | - ->description('The config code') |
|
| 25 | - ->notNull() |
|
| 26 | - ->index(); |
|
| 27 | - $table->string('value') |
|
| 28 | - ->description('The config value'); |
|
| 29 | - $table->string('type') |
|
| 30 | - ->description('The config data type'); |
|
| 31 | - $table->text('comment') |
|
| 32 | - ->description('The config description'); |
|
| 33 | - $table->integer('status') |
|
| 34 | - ->description('The config status') |
|
| 35 | - ->defaultValue(0) |
|
| 36 | - ->notNull(); |
|
| 37 | - $table->datetime('created_at') |
|
| 38 | - ->description('role created at') |
|
| 39 | - ->notNull(); |
|
| 40 | - $table->datetime('updated_at') |
|
| 41 | - ->description('role updated at'); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->create('config', function (CreateTable $table) { |
|
| 14 | + $table->integer('id') |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | + $table->string('env') |
|
| 18 | + ->description('The config environment') |
|
| 19 | + ->index(); |
|
| 20 | + $table->string('module') |
|
| 21 | + ->description('The module') |
|
| 22 | + ->index(); |
|
| 23 | + $table->string('code') |
|
| 24 | + ->description('The config code') |
|
| 25 | + ->notNull() |
|
| 26 | + ->index(); |
|
| 27 | + $table->string('value') |
|
| 28 | + ->description('The config value'); |
|
| 29 | + $table->string('type') |
|
| 30 | + ->description('The config data type'); |
|
| 31 | + $table->text('comment') |
|
| 32 | + ->description('The config description'); |
|
| 33 | + $table->integer('status') |
|
| 34 | + ->description('The config status') |
|
| 35 | + ->defaultValue(0) |
|
| 36 | + ->notNull(); |
|
| 37 | + $table->datetime('created_at') |
|
| 38 | + ->description('role created at') |
|
| 39 | + ->notNull(); |
|
| 40 | + $table->datetime('updated_at') |
|
| 41 | + ->description('role updated at'); |
|
| 42 | 42 | |
| 43 | - $table->engine('INNODB'); |
|
| 44 | - }); |
|
| 43 | + $table->engine('INNODB'); |
|
| 44 | + }); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function down(): void |
| 48 | 48 | { |
| 49 | - //Action when migrate down |
|
| 50 | - $this->drop('config'); |
|
| 49 | + //Action when migrate down |
|
| 50 | + $this->drop('config'); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |
@@ -157,13 +157,13 @@ |
||
| 157 | 157 | foreach ($results as $cfg) { |
| 158 | 158 | if ($cfg->parent) { |
| 159 | 159 | $results = $this->queryBuilder |
| 160 | - ->from($this->table) |
|
| 161 | - ->where('env')->is($cfg->env) |
|
| 162 | - ->where('module')->is($cfg->parent) |
|
| 163 | - ->where('status')->is(1) |
|
| 164 | - ->select() |
|
| 165 | - ->fetchObject() |
|
| 166 | - ->all(); |
|
| 160 | + ->from($this->table) |
|
| 161 | + ->where('env')->is($cfg->env) |
|
| 162 | + ->where('module')->is($cfg->parent) |
|
| 163 | + ->where('status')->is(1) |
|
| 164 | + ->select() |
|
| 165 | + ->fetchObject() |
|
| 166 | + ->all(); |
|
| 167 | 167 | |
| 168 | 168 | foreach ($results as $cfg) { |
| 169 | 169 | $config[$cfg->name] = $cfg->value ?? $cfg->default_value; |