@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ) { |
75 | 75 | parent::__construct($application, $filesystem); |
76 | 76 | $this->setName('make:action') |
77 | - ->setDescription('Command to generate new request handler class'); |
|
77 | + ->setDescription('Command to generate new request handler class'); |
|
78 | 78 | |
79 | 79 | $this->addOption('-o|--overwrite', 'Overwrite existing files.', false, false); |
80 | 80 | } |
@@ -85,31 +85,3 @@ discard block |
||
85 | 85 | public function getClassTemplate(): string |
86 | 86 | { |
87 | 87 | return <<<EOF |
88 | - <?php |
|
89 | - |
|
90 | - declare(strict_types=1); |
|
91 | - |
|
92 | - namespace %namespace%; |
|
93 | - |
|
94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
95 | - use Platine\Http\ResponseInterface; |
|
96 | - use Platine\Http\ServerRequestInterface; |
|
97 | - |
|
98 | - /** |
|
99 | - * @class %classname% |
|
100 | - * @package %namespace% |
|
101 | - */ |
|
102 | - class %classname% implements RequestHandlerInterface |
|
103 | - { |
|
104 | - |
|
105 | - /** |
|
106 | - * {@inheritodc} |
|
107 | - */ |
|
108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
109 | - { |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - EOF; |
|
114 | - } |
|
115 | -} |
@@ -85,31 +85,3 @@ |
||
85 | 85 | public function getClassTemplate(): string |
86 | 86 | { |
87 | 87 | return <<<EOF |
88 | - <?php |
|
89 | - |
|
90 | - declare(strict_types=1); |
|
91 | - |
|
92 | - namespace %namespace%; |
|
93 | - |
|
94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
95 | - use Platine\Http\ResponseInterface; |
|
96 | - use Platine\Http\ServerRequestInterface; |
|
97 | - |
|
98 | - /** |
|
99 | - * @class %classname% |
|
100 | - * @package %namespace% |
|
101 | - */ |
|
102 | - class %classname% implements RequestHandlerInterface |
|
103 | - { |
|
104 | - |
|
105 | - /** |
|
106 | - * {@inheritodc} |
|
107 | - */ |
|
108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
109 | - { |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - EOF; |
|
114 | - } |
|
115 | -} |
@@ -85,31 +85,3 @@ |
||
85 | 85 | public function getClassTemplate(): string |
86 | 86 | { |
87 | 87 | return <<<EOF |
88 | - <?php |
|
89 | - |
|
90 | - declare(strict_types=1); |
|
91 | - |
|
92 | - namespace %namespace%; |
|
93 | - |
|
94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
95 | - use Platine\Http\ResponseInterface; |
|
96 | - use Platine\Http\ServerRequestInterface; |
|
97 | - |
|
98 | - /** |
|
99 | - * @class %classname% |
|
100 | - * @package %namespace% |
|
101 | - */ |
|
102 | - class %classname% implements RequestHandlerInterface |
|
103 | - { |
|
104 | - |
|
105 | - /** |
|
106 | - * {@inheritodc} |
|
107 | - */ |
|
108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
109 | - { |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - EOF; |
|
114 | - } |
|
115 | -} |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * @class MakeActionCommand |
56 | 56 | * @package Platine\Framework\Console\Command |
57 | 57 | */ |
58 | -class MakeActionCommand extends MakeCommand |
|
59 | -{ |
|
58 | +class MakeActionCommand extends MakeCommand { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * {@inheritodc} |
@@ -85,31 +84,3 @@ discard block |
||
85 | 84 | public function getClassTemplate(): string |
86 | 85 | { |
87 | 86 | return <<<EOF |
88 | - <?php |
|
89 | - |
|
90 | - declare(strict_types=1); |
|
91 | - |
|
92 | - namespace %namespace%; |
|
93 | - |
|
94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
95 | - use Platine\Http\ResponseInterface; |
|
96 | - use Platine\Http\ServerRequestInterface; |
|
97 | - |
|
98 | - /** |
|
99 | - * @class %classname% |
|
100 | - * @package %namespace% |
|
101 | - */ |
|
102 | - class %classname% implements RequestHandlerInterface |
|
103 | - { |
|
104 | - |
|
105 | - /** |
|
106 | - * {@inheritodc} |
|
107 | - */ |
|
108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
109 | - { |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - EOF; |
|
114 | - } |
|
115 | -} |
@@ -85,31 +85,3 @@ |
||
85 | 85 | public function getClassTemplate(): string |
86 | 86 | { |
87 | 87 | return <<<EOF |
88 | - <?php |
|
89 | - |
|
90 | - declare(strict_types=1); |
|
91 | - |
|
92 | - namespace %namespace%; |
|
93 | - |
|
94 | - use Platine\Http\Handler\RequestHandlerInterface; |
|
95 | - use Platine\Http\ResponseInterface; |
|
96 | - use Platine\Http\ServerRequestInterface; |
|
97 | - |
|
98 | - /** |
|
99 | - * @class %classname% |
|
100 | - * @package %namespace% |
|
101 | - */ |
|
102 | - class %classname% implements RequestHandlerInterface |
|
103 | - { |
|
104 | - |
|
105 | - /** |
|
106 | - * {@inheritodc} |
|
107 | - */ |
|
108 | - public function handle(ServerRequestInterface \$request): ResponseInterface |
|
109 | - { |
|
110 | - } |
|
111 | - } |
|
112 | - |
|
113 | - EOF; |
|
114 | - } |
|
115 | -} |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @class MakeCommand |
58 | 58 | * @package Platine\Framework\Console |
59 | 59 | */ |
60 | -abstract class MakeCommand extends Command |
|
61 | -{ |
|
60 | +abstract class MakeCommand extends Command { |
|
62 | 61 | |
63 | 62 | /** |
64 | 63 | * The Application instance |
@@ -111,8 +110,7 @@ discard block |
||
111 | 110 | /** |
112 | 111 | * {@inheritodc} |
113 | 112 | */ |
114 | - public function execute() |
|
115 | - { |
|
113 | + public function execute() { |
|
116 | 114 | $writer = $this->io()->writer(); |
117 | 115 | $name = $this->getArgumentValue('name'); |
118 | 116 | $cleanName = str_replace('/', '\\', $name); |
@@ -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', ['permission' => 'view_user']); |
88 | 88 | $router->get('/detail/{id:i}', DetailAction::class, 'user_detail'); |
89 | 89 | $router->post('/batch', BatchAction::class, 'user_batch'); |
@@ -61,8 +61,7 @@ |
||
61 | 61 | * @class UserServiceProvider |
62 | 62 | * @package Platine\Framework\Demo\Provider |
63 | 63 | */ |
64 | -class UserServiceProvider extends ServiceProvider |
|
65 | -{ |
|
64 | +class UserServiceProvider extends ServiceProvider { |
|
66 | 65 | |
67 | 66 | /** |
68 | 67 | * {@inheritdoc} |
@@ -79,8 +79,8 @@ |
||
79 | 79 | foreach ($pages as $page) { |
80 | 80 | if ($page->getUrl() !== null) { |
81 | 81 | $html .= '<li class = "page-item' . ($page->isCurrent() ? ' active"' : '"') |
82 | - . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
83 | - . $page->getNumber() . '</a></li>'; |
|
82 | + . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
83 | + . $page->getNumber() . '</a></li>'; |
|
84 | 84 | } else { |
85 | 85 | $html .= '<li class = "page-item disabled"><a href="#" class="page-link">' |
86 | 86 | . $page->getNumber() . '</a></li>'; |
@@ -54,8 +54,7 @@ |
||
54 | 54 | * @class BootstrapRenderer |
55 | 55 | * @package Platine\Framework\Pagination |
56 | 56 | */ |
57 | -class BootstrapRenderer implements RendererInterface |
|
58 | -{ |
|
57 | +class BootstrapRenderer implements RendererInterface { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * {@inheritdoc} |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * @class ServerRequestUrlGenerator |
55 | 55 | * @package Platine\Framework\Pagination |
56 | 56 | */ |
57 | -class ServerRequestUrlGenerator implements UrlGeneratorInterface |
|
58 | -{ |
|
57 | +class ServerRequestUrlGenerator implements UrlGeneratorInterface { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * The server request instance |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | * @param ServerRequestInterface $request |
81 | 80 | * @param string $queryName |
82 | 81 | */ |
83 | - public function __construct(ServerRequestInterface $request, string $queryName) |
|
84 | - { |
|
82 | + public function __construct(ServerRequestInterface $request, string $queryName) { |
|
85 | 83 | $this->request = $request; |
86 | 84 | $this->queryVarName = $queryName; |
87 | 85 |
@@ -91,12 +91,12 @@ |
||
91 | 91 | public function setValidationRules(): void |
92 | 92 | { |
93 | 93 | $this->addRules('username', [ |
94 | - new NotEmpty(), |
|
95 | - new MinLength(3) |
|
94 | + new NotEmpty(), |
|
95 | + new MinLength(3) |
|
96 | 96 | ]); |
97 | 97 | |
98 | 98 | $this->addRules('password', [ |
99 | - new NotEmpty(), |
|
99 | + new NotEmpty(), |
|
100 | 100 | ]); |
101 | 101 | } |
102 | 102 | } |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @class AuthValidator |
58 | 58 | * @package Platine\Framework\Demo\Form\Validator |
59 | 59 | */ |
60 | -class AuthValidator extends AbstractValidator |
|
61 | -{ |
|
60 | +class AuthValidator extends AbstractValidator { |
|
62 | 61 | /** |
63 | 62 | * The parameter instance |
64 | 63 | * @var AuthParam |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | * @param AuthParam $param |
71 | 70 | * @param Lang $lang |
72 | 71 | */ |
73 | - public function __construct(AuthParam $param, Lang $lang) |
|
74 | - { |
|
72 | + public function __construct(AuthParam $param, Lang $lang) { |
|
75 | 73 | parent::__construct($lang); |
76 | 74 | $this->param = $param; |
77 | 75 | } |
@@ -92,12 +92,12 @@ |
||
92 | 92 | public function setValidationRules(): void |
93 | 93 | { |
94 | 94 | $this->addRules('name', [ |
95 | - new NotEmpty(), |
|
96 | - new MinLength(2) |
|
95 | + new NotEmpty(), |
|
96 | + new MinLength(2) |
|
97 | 97 | ]); |
98 | 98 | |
99 | 99 | $this->addRules('description', [ |
100 | - new MinLength(3) |
|
100 | + new MinLength(3) |
|
101 | 101 | ]); |
102 | 102 | } |
103 | 103 | } |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @class RoleValidator |
58 | 58 | * @package Platine\Framework\Demo\Form\Validator |
59 | 59 | */ |
60 | -class RoleValidator extends AbstractValidator |
|
61 | -{ |
|
60 | +class RoleValidator extends AbstractValidator { |
|
62 | 61 | |
63 | 62 | /** |
64 | 63 | * The parameter instance |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | * @param RoleParam $param |
72 | 71 | * @param Lang $lang |
73 | 72 | */ |
74 | - public function __construct(RoleParam $param, Lang $lang) |
|
75 | - { |
|
73 | + public function __construct(RoleParam $param, Lang $lang) { |
|
76 | 74 | parent::__construct($lang); |
77 | 75 | $this->param = $param; |
78 | 76 | } |
@@ -100,37 +100,37 @@ |
||
100 | 100 | public function setValidationRules(): void |
101 | 101 | { |
102 | 102 | $this->addRules('username', [ |
103 | - new NotEmpty(), |
|
104 | - new MinLength(3), |
|
105 | - new AlphaDash() |
|
103 | + new NotEmpty(), |
|
104 | + new MinLength(3), |
|
105 | + new AlphaDash() |
|
106 | 106 | ]); |
107 | 107 | |
108 | 108 | $this->addRules('lastname', [ |
109 | - new NotEmpty(), |
|
110 | - new MinLength(3) |
|
109 | + new NotEmpty(), |
|
110 | + new MinLength(3) |
|
111 | 111 | ]); |
112 | 112 | |
113 | 113 | $this->addRules('firstname', [ |
114 | - new NotEmpty(), |
|
115 | - new MinLength(3) |
|
114 | + new NotEmpty(), |
|
115 | + new MinLength(3) |
|
116 | 116 | ]); |
117 | 117 | |
118 | 118 | $this->addRules('status', [ |
119 | - new NotEmpty(), |
|
120 | - new InList(['A', 'D']) |
|
119 | + new NotEmpty(), |
|
120 | + new InList(['A', 'D']) |
|
121 | 121 | ]); |
122 | 122 | |
123 | 123 | $this->addRules('email', [ |
124 | - new NotEmpty(), |
|
125 | - new Email() |
|
124 | + new NotEmpty(), |
|
125 | + new Email() |
|
126 | 126 | ]); |
127 | 127 | |
128 | 128 | $this->addRules('role', [ |
129 | - new MinLength(3) |
|
129 | + new MinLength(3) |
|
130 | 130 | ]); |
131 | 131 | |
132 | 132 | $this->addRules('password', [ |
133 | - new MinLength(5), |
|
133 | + new MinLength(5), |
|
134 | 134 | ]); |
135 | 135 | } |
136 | 136 | } |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | * @class UserValidator |
61 | 61 | * @package Platine\Framework\Demo\Form\Validator |
62 | 62 | */ |
63 | -class UserValidator extends AbstractValidator |
|
64 | -{ |
|
63 | +class UserValidator extends AbstractValidator { |
|
65 | 64 | |
66 | 65 | /** |
67 | 66 | * The parameter instance |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | * @param UserParam $param |
75 | 74 | * @param Lang $lang |
76 | 75 | */ |
77 | - public function __construct(UserParam $param, Lang $lang) |
|
78 | - { |
|
76 | + public function __construct(UserParam $param, Lang $lang) { |
|
79 | 77 | parent::__construct($lang); |
80 | 78 | $this->param = $param; |
81 | 79 | } |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * @class PermissionValidator |
59 | 59 | * @package Platine\Framework\Demo\Form\Validator |
60 | 60 | */ |
61 | -class PermissionValidator extends AbstractValidator |
|
62 | -{ |
|
61 | +class PermissionValidator extends AbstractValidator { |
|
63 | 62 | |
64 | 63 | /** |
65 | 64 | * The parameter instance |
@@ -72,8 +71,7 @@ discard block |
||
72 | 71 | * @param PermissionParam $param |
73 | 72 | * @param Lang $lang |
74 | 73 | */ |
75 | - public function __construct(PermissionParam $param, Lang $lang) |
|
76 | - { |
|
74 | + public function __construct(PermissionParam $param, Lang $lang) { |
|
77 | 75 | parent::__construct($lang); |
78 | 76 | $this->param = $param; |
79 | 77 | } |
@@ -94,18 +94,18 @@ |
||
94 | 94 | public function setValidationRules(): void |
95 | 95 | { |
96 | 96 | $this->addRules('code', [ |
97 | - new NotEmpty(), |
|
98 | - new MinLength(2), |
|
99 | - new AlphaNumericDash() |
|
97 | + new NotEmpty(), |
|
98 | + new MinLength(2), |
|
99 | + new AlphaNumericDash() |
|
100 | 100 | ]); |
101 | 101 | |
102 | 102 | $this->addRules('description', [ |
103 | - new NotEmpty(), |
|
104 | - new MinLength(3) |
|
103 | + new NotEmpty(), |
|
104 | + new MinLength(3) |
|
105 | 105 | ]); |
106 | 106 | |
107 | 107 | $this->addRules('depend', [ |
108 | - new MinLength(2) |
|
108 | + new MinLength(2) |
|
109 | 109 | ]); |
110 | 110 | } |
111 | 111 | } |