Test Setup Failed
Push — feature/code_refactoring ( 66b2b5...806945 )
by Alessandro
03:09 queued 59s
created
src/Controller/Component/UserPermissionsComponent.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 *
37 37
 * @param string $event The event to use.
38 38
 */
39
-    public function initialize(array $config)
40
-    {
41
-        parent::initialize($config);
39
+	public function initialize(array $config)
40
+	{
41
+		parent::initialize($config);
42 42
         
43
-        $this->controller = $this->_registry->getController();
44
-        $this->session = $this->controller->request->session();
45
-    }
43
+		$this->controller = $this->_registry->getController();
44
+		$this->session = $this->controller->request->session();
45
+	}
46 46
 
47 47
 /**
48 48
 * Initialization to get controller variable
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 * @param array $rules Array of rules for permissions.
51 51
 * @return string '0' if user / group doesn't have permission, 1 if has permission
52 52
 */
53
-    public function allow ($rules) {
54
-    	$user_id = $this->session->read('Auth.User.id');
53
+	public function allow ($rules) {
54
+		$user_id = $this->session->read('Auth.User.id');
55 55
 
56 56
 		$actions 	= array();
57 57
 		$bool 		= true;
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
 		foreach($rules as $key => $value){
67 67
 			switch($key){
68 68
 				case "user_type":
69
-			        $userType = $value;
70
-			        break;
71
-			    case "redirect":
72
-			        $redirect = $value;
73
-			        break;
74
-			    case "action":
75
-			        $action = $value;
76
-			        break;
77
-			    case "controller":
78
-			        $controller = $value;
79
-			        break;
80
-			    case "message":
81
-			        $message = $value;
82
-			        break;
69
+					$userType = $value;
70
+					break;
71
+				case "redirect":
72
+					$redirect = $value;
73
+					break;
74
+				case "action":
75
+					$action = $value;
76
+					break;
77
+				case "controller":
78
+					$controller = $value;
79
+					break;
80
+				case "message":
81
+					$message = $value;
82
+					break;
83 83
 			}
84 84
 		}
85 85
 
@@ -140,5 +140,5 @@  discard block
 block discarded – undo
140 140
 		}
141 141
 
142 142
 		return $bool;
143
-    }
143
+	}
144 144
 }
145 145
\ No newline at end of file
Please login to merge, or discard this patch.