Passed
Push — main ( e4a1c0...bae336 )
by Roberto
12:29
created
src/Controller/BaseController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,16 +18,16 @@
 block discarded – undo
18 18
         Liquid::set('INCLUDE_SUFFIX', 'html');
19 19
         Liquid::set('INCLUDE_PREFIX', '');
20 20
         $path = "app/Views";
21
-        $template  = new Template($path);
21
+        $template = new Template($path);
22 22
         $template->registerFilter(new SiteFilter());
23 23
 
24
-        if(isset($this->custom_filters)){
25
-            foreach($this->custom_filters as $filter){
24
+        if (isset($this->custom_filters)) {
25
+            foreach ($this->custom_filters as $filter) {
26 26
                 $template->registerFilter(new $filter());
27 27
             }
28 28
         }
29 29
         $template->parseFile($view);
30
-        $parameters = array_map(function ($x) {
30
+        $parameters = array_map(function($x) {
31 31
             if ($x instanceof QuerySet) {
32 32
                 return $x->do();
33 33
             } else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $template  = new Template($path);
22 22
         $template->registerFilter(new SiteFilter());
23 23
 
24
-        if(isset($this->custom_filters)){
24
+        if(isset($this->custom_filters)) {
25 25
             foreach($this->custom_filters as $filter){
26 26
                 $template->registerFilter(new $filter());
27 27
             }
Please login to merge, or discard this patch.
src/Middleware/BaseAccessControlMiddleware.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,18 +14,17 @@  discard block
 block discarded – undo
14 14
 
15 15
     protected function handle(mixed ...$middlewareParams): HttpResponse|Request
16 16
     {
17
-        if($this->match instanceof MatchRoute) {
17
+        if ($this->match instanceof MatchRoute) {
18 18
             $reflection = new \ReflectionMethod($this->match->controller, $this->match->method);
19 19
             $attributes = $reflection->getAttributes();
20 20
 
21 21
             foreach ($attributes as $attribute) {
22
-                if(is_subclass_of($attribute->getName(), AbstractAccessControlAttribute::class)) {
22
+                if (is_subclass_of($attribute->getName(), AbstractAccessControlAttribute::class)) {
23 23
                     return
24
-                        $this->checkPermissions($attribute->getName(),  ...($attribute->getArguments()))?
25
-                        $this->request :
26
-                        new RedirectResponse(
24
+                        $this->checkPermissions($attribute->getName(), ...($attribute->getArguments())) ?
25
+                        $this->request : new RedirectResponse(
27 26
                             Application::getAuthConfig()->login_url,
28
-                            redirect_after: $this->request->url
27
+                            redirect_after : $this->request->url
29 28
                         );
30 29
                 }
31 30
 
@@ -36,7 +35,7 @@  discard block
 block discarded – undo
36 35
 
37 36
 
38 37
     protected function checkPermissions(string $modifier, mixed ...$params):bool{
39
-        if($modifier == LoginRequired::class){
38
+        if ($modifier == LoginRequired::class) {
40 39
             $authenticator = new \Lepton\Authenticator\UserAuthenticator();
41 40
             return $authenticator->isLoggedIn();
42 41
         }
Please login to merge, or discard this patch.