@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * class ConfigCommand |
| 57 | 57 | * @package Platine\Framework\Console\Command |
| 58 | 58 | */ |
| 59 | -class ConfigCommand extends Command |
|
| 60 | -{ |
|
| 59 | +class ConfigCommand extends Command { |
|
| 61 | 60 | |
| 62 | 61 | protected Application $application; |
| 63 | 62 | |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param Application $application |
| 67 | 66 | */ |
| 68 | - public function __construct(Application $application) |
|
| 69 | - { |
|
| 67 | + public function __construct(Application $application) { |
|
| 70 | 68 | parent::__construct('config', 'Command to manage configuration'); |
| 71 | 69 | |
| 72 | 70 | $this->addOption('-l|--list', 'List the configuration', '', false); |
@@ -75,8 +73,7 @@ discard block |
||
| 75 | 73 | $this->application = $application; |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | - public function execute() |
|
| 79 | - { |
|
| 76 | + public function execute() { |
|
| 80 | 77 | if ($this->getOptionValue('list')) { |
| 81 | 78 | $this->showConfigList(); |
| 82 | 79 | } |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * class RouteCommand |
| 60 | 60 | * @package Platine\Framework\Console\Command |
| 61 | 61 | */ |
| 62 | -class RouteCommand extends Command |
|
| 63 | -{ |
|
| 62 | +class RouteCommand extends Command { |
|
| 64 | 63 | protected Config $config; |
| 65 | 64 | protected Router $router; |
| 66 | 65 | protected Application $application; |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * @param Config $config |
| 72 | 71 | * @param Router $router |
| 73 | 72 | */ |
| 74 | - public function __construct(Application $application, Config $config, Router $router) |
|
| 75 | - { |
|
| 73 | + public function __construct(Application $application, Config $config, Router $router) { |
|
| 76 | 74 | parent::__construct('route', 'Command to manage route'); |
| 77 | 75 | |
| 78 | 76 | $this->addOption('-l|--list', 'Show route list', null, false); |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | $this->application = $application; |
| 83 | 81 | } |
| 84 | 82 | |
| 85 | - public function execute() |
|
| 86 | - { |
|
| 83 | + public function execute() { |
|
| 87 | 84 | if ($this->getOptionValue('list')) { |
| 88 | 85 | $this->showRouteList(); |
| 89 | 86 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->template, |
| 83 | 83 | 'user/login', |
| 84 | 84 | [ |
| 85 | - 'param' => $formParam |
|
| 85 | + 'param' => $formParam |
|
| 86 | 86 | ] |
| 87 | 87 | ); |
| 88 | 88 | } |
@@ -95,16 +95,16 @@ discard block |
||
| 95 | 95 | $this->template, |
| 96 | 96 | 'user/login', |
| 97 | 97 | [ |
| 98 | - 'param' => $formParam |
|
| 98 | + 'param' => $formParam |
|
| 99 | 99 | ] |
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $data = [ |
| 104 | - 'id' => $user->user_id, |
|
| 105 | - 'username' => $user->username, |
|
| 106 | - 'lastname' => $user->lname, |
|
| 107 | - 'firstname' => $user->fname, |
|
| 104 | + 'id' => $user->user_id, |
|
| 105 | + 'username' => $user->username, |
|
| 106 | + 'lastname' => $user->lname, |
|
| 107 | + 'firstname' => $user->fname, |
|
| 108 | 108 | ]; |
| 109 | 109 | $this->session->set('user', $data); |
| 110 | 110 | |
@@ -14,8 +14,7 @@ |
||
| 14 | 14 | * |
| 15 | 15 | * @author tony |
| 16 | 16 | */ |
| 17 | -class LogoutAction implements RequestHandlerInterface |
|
| 18 | -{ |
|
| 17 | +class LogoutAction implements RequestHandlerInterface { |
|
| 19 | 18 | |
| 20 | 19 | protected Session $session; |
| 21 | 20 | protected RouteHelper $routeHelper; |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | * |
| 14 | 14 | * @author tony |
| 15 | 15 | */ |
| 16 | -class HomeAction implements RequestHandlerInterface |
|
| 17 | -{ |
|
| 16 | +class HomeAction implements RequestHandlerInterface { |
|
| 18 | 17 | protected Template $template; |
| 19 | 18 | |
| 20 | 19 | public function __construct( |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @author tony |
| 17 | 17 | */ |
| 18 | -class SessionTag extends AbstractTag |
|
| 19 | -{ |
|
| 18 | +class SessionTag extends AbstractTag { |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * The key of the session |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * {@inheritdoc} |
| 29 | 28 | */ |
| 30 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 31 | - { |
|
| 29 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 32 | 30 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 33 | 31 | if ($lexer->match($markup)) { |
| 34 | 32 | $this->name = $lexer->getStringMatch(0); |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | protected string $path; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * {@inheritdoc} |
|
| 29 | - */ |
|
| 28 | + * {@inheritdoc} |
|
| 29 | + */ |
|
| 30 | 30 | public function __construct(string $markup, &$tokens, Parser $parser) |
| 31 | 31 | { |
| 32 | 32 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @author tony |
| 17 | 17 | */ |
| 18 | -class StaticTag extends AbstractTag |
|
| 19 | -{ |
|
| 18 | +class StaticTag extends AbstractTag { |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * The static path |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * {@inheritdoc} |
| 29 | 28 | */ |
| 30 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 31 | - { |
|
| 29 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 32 | 30 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 33 | 31 | if ($lexer->match($markup)) { |
| 34 | 32 | $this->path = $lexer->getStringMatch(0); |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @author tony |
| 17 | 17 | */ |
| 18 | -class SessionFlashTag extends AbstractTag |
|
| 19 | -{ |
|
| 18 | +class SessionFlashTag extends AbstractTag { |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * The key of the session |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * {@inheritdoc} |
| 29 | 28 | */ |
| 30 | - public function __construct(string $markup, &$tokens, Parser $parser) |
|
| 31 | - { |
|
| 29 | + public function __construct(string $markup, &$tokens, Parser $parser) { |
|
| 32 | 30 | $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/'); |
| 33 | 31 | if ($lexer->match($markup)) { |
| 34 | 32 | $this->name = $lexer->getStringMatch(0); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | */ |
| 84 | 84 | public function addRoutes(Router $router): void |
| 85 | 85 | { |
| 86 | - $router->group('/users', function (Router $router) { |
|
| 86 | + $router->group('/users', function(Router $router) { |
|
| 87 | 87 | $router->get('', ListAction::class, 'user_list'); |
| 88 | 88 | $router->get('/detail/{id:i}', DetailAction::class, 'user_detail'); |
| 89 | 89 | $router->get('/delete/{id:i}', DeleteAction::class, 'user_delete'); |