Passed
Push — main ( aea47e...7f34fc )
by Roberto
12:44
created
src/Middleware/ACFMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,18 +22,18 @@
 block discarded – undo
22 22
     protected function checkPermissions(string $modifier, mixed ...$params): bool
23 23
     {
24 24
 
25
-        if($modifier == LoginRequired::class) {
25
+        if ($modifier == LoginRequired::class) {
26 26
             $level = $params[0] ?? 1;
27 27
 
28 28
             $authenticator = new \Lepton\Authenticator\UserAuthenticator();
29 29
             $loggedIn = $authenticator->isLoggedIn();
30
-            if(! $loggedIn) {
30
+            if (!$loggedIn) {
31 31
                 return false;
32 32
             }
33 33
             $user = $authenticator->getLoggedUser();
34 34
             $splitted = explode("__", $this->level_field);
35 35
             $user_level = $user;
36
-            foreach($splitted as $part) {
36
+            foreach ($splitted as $part) {
37 37
                 $user_level = $user_level->$part;
38 38
             }
39 39
             return ($user_level >= $level);
Please login to merge, or discard this patch.
src/Middleware/ConditionalRedirectMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
 {
12 12
     protected function handle(mixed ...$middlewareParams): HttpResponse|Request
13 13
     {
14
-        $url = preg_replace("/^" . str_replace("/", "\/", Application::getAppConfig()->base_url) . "\//", "", $this->request->url);
14
+        $url = preg_replace("/^".str_replace("/", "\/", Application::getAppConfig()->base_url)."\//", "", $this->request->url);
15 15
 
16
-        if(!in_array($url, $middlewareParams["allow"])){
17
-            if($this->check_request($middlewareParams)){
16
+        if (!in_array($url, $middlewareParams["allow"])) {
17
+            if ($this->check_request($middlewareParams)) {
18 18
                 return new RedirectResponse($middlewareParams["redirect"], htmx: false, parse: false);
19 19
             }
20 20
         }
Please login to merge, or discard this patch.