Passed
Push — master ( 04b25a...0f4066 )
by Filippo
02:23
created
src/Daikengo/Collection/RoleCollection.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@  discard block
 block discarded – undo
48 48
    */
49 49
   public function grant(IRole $role) {
50 50
     // Checks if the same role has been already assigned to the member.
51
-    if ($this->exists($role))
52
-      return;
51
+    if ($this->exists($role)) {
52
+          return;
53
+    }
53 54
 
54 55
     $roles = $this->meta[$this->name];
55 56
 
@@ -59,8 +60,7 @@  discard block
 block discarded – undo
59 60
         // If a subclass of `$role` exists for the current collection then the function returns, because a more
60 61
         // important role has been already assigned to the member.
61 62
         return;
62
-      }
63
-      elseif (is_subclass_of($role, $class, FALSE)) {
63
+      } elseif (is_subclass_of($role, $class, FALSE)) {
64 64
         // If `$role` is an instance of a subclass of any role previously assigned to the member that means the new role
65 65
         // is more important and the one already assigned must be removed.
66 66
         unset($this->meta[$this->name][$name]);
@@ -78,8 +78,9 @@  discard block
 block discarded – undo
78 78
    * @param IRole $role A role object.
79 79
    */
80 80
   public function revoke(IRole $role) {
81
-    if ($this->exists($role))
82
-      unset($this->meta[$this->name][$role->getName()]);
81
+    if ($this->exists($role)) {
82
+          unset($this->meta[$this->name][$role->getName()]);
83
+    }
83 84
   }
84 85
 
85 86
 
Please login to merge, or discard this patch.