@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function register(): void |
71 | 71 | { |
72 | - $this->app->bind(UrlGeneratorInterface::class, function (ContainerInterface $app) { |
|
72 | + $this->app->bind(UrlGeneratorInterface::class, function(ContainerInterface $app) { |
|
73 | 73 | return new ServerRequestUrlGenerator( |
74 | 74 | $app->get(ServerRequestInterface::class), |
75 | 75 | 'page' |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | }); |
78 | 78 | $this->app->bind(RendererInterface::class, BootstrapRenderer::class); |
79 | 79 | $this->app->bind(Pagination::class); |
80 | - $this->app->bind(Pagination::class, function (ContainerInterface $app) { |
|
80 | + $this->app->bind(Pagination::class, function(ContainerInterface $app) { |
|
81 | 81 | $pagination = new Pagination( |
82 | 82 | $app->get(UrlGeneratorInterface::class), |
83 | 83 | $app->get(RendererInterface::class) |
@@ -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 | -} |
@@ -71,7 +71,7 @@ |
||
71 | 71 | 'updated_at' => '?date', |
72 | 72 | ]); |
73 | 73 | |
74 | - $mapper->filter('status', function (Query $q, $status) { |
|
74 | + $mapper->filter('status', function(Query $q, $status) { |
|
75 | 75 | $q->where('status')->is($status); |
76 | 76 | }); |
77 | 77 | } |
@@ -122,7 +122,7 @@ |
||
122 | 122 | $totalItems = $this->userRepository->query() |
123 | 123 | ->filter($filters) |
124 | 124 | ->count('id'); |
125 | - $currentPage = (int)$param->get('page', 1); |
|
125 | + $currentPage = (int) $param->get('page', 1); |
|
126 | 126 | $this->pagination->setTotalItems($totalItems) |
127 | 127 | ->setCurrentPage($currentPage); |
128 | 128 | $limit = $this->pagination->getItemsPerPage(); |
@@ -108,7 +108,7 @@ |
||
108 | 108 | ////////// BEGIN PAGINATION ////////////////// |
109 | 109 | $totalItems = $this->permissionRepository->query() |
110 | 110 | ->count('id'); |
111 | - $currentPage = (int)$param->get('page', 1); |
|
111 | + $currentPage = (int) $param->get('page', 1); |
|
112 | 112 | $this->pagination->setTotalItems($totalItems) |
113 | 113 | ->setCurrentPage($currentPage); |
114 | 114 | $limit = $this->pagination->getItemsPerPage(); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | ////////// BEGIN PAGINATION ////////////////// |
108 | 108 | $totalItems = $this->roleRepository->query() |
109 | 109 | ->count('id'); |
110 | - $currentPage = (int)$param->get('page', 1); |
|
110 | + $currentPage = (int) $param->get('page', 1); |
|
111 | 111 | $this->pagination->setTotalItems($totalItems) |
112 | 112 | ->setCurrentPage($currentPage); |
113 | 113 | $limit = $this->pagination->getItemsPerPage(); |
@@ -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'); |