@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | return $loader->loadClassFromFile( |
| 107 | 107 | $controllerPath, |
| 108 | - function () { return ControllerException::controllerNotFound(current_controller()); }, |
|
| 109 | - function () { return ControllerException::controllerNotDefined(current_controller()); } |
|
| 108 | + function() { return ControllerException::controllerNotFound(current_controller()); }, |
|
| 109 | + function() { return ControllerException::controllerNotDefined(current_controller()); } |
|
| 110 | 110 | ); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | private static function routeParams(): array |
| 147 | 147 | { |
| 148 | - return array_map(function ($param) { |
|
| 148 | + return array_map(function($param) { |
|
| 149 | 149 | return $param['value']; |
| 150 | 150 | }, route_params()); |
| 151 | 151 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $currentMiddleware = $this->getMiddleware($request, $response); |
| 68 | 68 | |
| 69 | - list($request, $response) = $currentMiddleware->apply($request, $response, function ($request, $response) { |
|
| 69 | + list($request, $response) = $currentMiddleware->apply($request, $response, function($request, $response) { |
|
| 70 | 70 | next($this->middlewares); |
| 71 | 71 | return [$request, $response]; |
| 72 | 72 | }); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | return $loader->loadClassFromFile( |
| 91 | 91 | $middlewarePath, |
| 92 | - function () { return MiddlewareException::middlewareNotFound(current($this->middlewares)); }, |
|
| 93 | - function () { return MiddlewareException::notDefined(current($this->middlewares)); }, |
|
| 92 | + function() { return MiddlewareException::middlewareNotFound(current($this->middlewares)); }, |
|
| 93 | + function() { return MiddlewareException::notDefined(current($this->middlewares)); }, |
|
| 94 | 94 | [$request, $response] |
| 95 | 95 | ); |
| 96 | 96 | } |
@@ -211,7 +211,7 @@ |
||
| 211 | 211 | private function replacePlaceholders(string $content): string |
| 212 | 212 | { |
| 213 | 213 | $placeholders = [ |
| 214 | - '{{MODULE_NAMESPACE}}' => $this->getBaseNamespace() .'\\' . $this->getModuleName(), |
|
| 214 | + '{{MODULE_NAMESPACE}}' => $this->getBaseNamespace() . '\\' . $this->getModuleName(), |
|
| 215 | 215 | '{{MODULE_NAME}}' => $this->getModuleName(), |
| 216 | 216 | ]; |
| 217 | 217 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($route) { |
|
| 3 | +return function($route) { |
|
| 4 | 4 | $route->get('/', 'MainController', 'index'); |
| 5 | 5 | }; |
| 6 | 6 | \ No newline at end of file |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | ]); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - /** |
|
| 49 | + /** |
|
| 50 | 50 | * Action - display home page |
| 51 | 51 | * @param Response $response |
| 52 | 52 | * @param ViewFactory $view |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($route) { |
|
| 3 | +return function($route) { |
|
| 4 | 4 | $route->get('/', 'MainController', 'index'); |
| 5 | 5 | }; |
| 6 | 6 | \ No newline at end of file |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function apply(Request $request, Response $response, Closure $next) |
| 38 | 38 | { |
| 39 | - $postId = (string)route_param('id'); |
|
| 39 | + $postId = (string) route_param('id'); |
|
| 40 | 40 | |
| 41 | 41 | $post = ServiceFactory::get(PostService::class)->getPost($postId); |
| 42 | 42 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $this->validator = new Validator(); |
| 44 | 44 | |
| 45 | - $this->validator->addValidation('uniqueUser', function ($value) { |
|
| 45 | + $this->validator->addValidation('uniqueUser', function($value) { |
|
| 46 | 46 | $userModel = ModelFactory::get(User::class); |
| 47 | 47 | return empty($userModel->findOneBy('email', $value)->asArray()); |
| 48 | 48 | }); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function myPosts(Response $response, PostTransformer $transformer) |
| 110 | 110 | { |
| 111 | - $myPosts = $this->postService->getMyPosts((int)auth()->user()->id); |
|
| 111 | + $myPosts = $this->postService->getMyPosts((int) auth()->user()->id); |
|
| 112 | 112 | |
| 113 | 113 | $response->json([ |
| 114 | 114 | 'status' => 'success', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | public function create(Request $request, Response $response) |
| 125 | 125 | { |
| 126 | 126 | $postData = [ |
| 127 | - 'user_id' => (int)auth()->user()->id, |
|
| 127 | + 'user_id' => (int) auth()->user()->id, |
|
| 128 | 128 | 'title' => $request->get('title', null, true), |
| 129 | 129 | 'content' => $request->get('content', null, true), |
| 130 | 130 | 'image' => '', |