Passed
Push — master ( 04b25a...0f4066 )
by Filippo
02:23
created
src/Daikengo/Permission/AbstractPermission.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,10 +49,11 @@
 block discarded – undo
49 49
    * @return mixed
50 50
    */
51 51
   public function __call($name, array $arguments) {
52
-    if (is_callable($this->$name))
53
-      return call_user_func($this->$name, $arguments);
54
-    else
55
-      throw new \RuntimeException("Method {$name} does not exist.");
52
+    if (is_callable($this->$name)) {
53
+          return call_user_func($this->$name, $arguments);
54
+    } else {
55
+          throw new \RuntimeException("Method {$name} does not exist.");
56
+    }
56 57
   }
57 58
 
58 59
 
Please login to merge, or discard this patch.
src/Daikengo/Role/IRole.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
  * `YourNamespace\WhateverYouWant\Developer\LintPermission`.
29 29
  * @nosubgrouping
30 30
  */
31
-interface IRole  {
31
+interface IRole {
32 32
 
33 33
 
34 34
   /**
Please login to merge, or discard this patch.
src/Daikengo/User/Guest.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@
 block discarded – undo
57 57
 
58 58
       // Invokes the method.
59 59
       return $method->invoke($permission);
60
+    } else {
61
+          return FALSE;
60 62
     }
61
-    else
62
-      return FALSE;
63 63
   }
64 64
 
65 65
 
Please login to merge, or discard this patch.
src/Daikengo/User/TMember.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,16 +72,17 @@
 block discarded – undo
72 72
 
73 73
           // Exits from the do while and foreach as well.
74 74
           break 2;
75
-        }
76
-        else {
75
+        } else {
77 76
           // Go back to the previous role class in the hierarchy. For example, from AdminRole to ModeratorRole.
78 77
           $parentRoleReflection = $roleReflection->getParentClass();
79 78
 
80 79
           // Proceed only if the parent role is not an abstract class.
81
-          if (is_object($parentRoleReflection) && !$parentRoleReflection->isAbstract())
82
-            $roleClass = $parentRoleReflection->name;
83
-          else
84
-            break; // No more roles in the hierarchy.
80
+          if (is_object($parentRoleReflection) && !$parentRoleReflection->isAbstract()) {
81
+                      $roleClass = $parentRoleReflection->name;
82
+          } else {
83
+                      break;
84
+          }
85
+          // No more roles in the hierarchy.
85 86
         }
86 87
       } while (TRUE);
87 88
 
Please login to merge, or discard this patch.
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.