Passed
Push — master ( 87b872...e0d998 )
by Filippo
02:11
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/Collection/RoleCollection.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,8 +46,9 @@  discard block
 block discarded – undo
46 46
    */
47 47
   public function grant(IRole $role) {
48 48
     // Checks if the same role has been already assigned to the member.
49
-    if ($this->exists($role))
50
-      return;
49
+    if ($this->exists($role)) {
50
+          return;
51
+    }
51 52
 
52 53
     $roles = $this->meta[$this->name];
53 54
 
@@ -57,8 +58,7 @@  discard block
 block discarded – undo
57 58
         // If a subclass of `$role` exists for the current collection then the function returns, because a more
58 59
         // important role has been already assigned to the member.
59 60
         return;
60
-      }
61
-      elseif (is_subclass_of($role, $class, FALSE)) {
61
+      } elseif (is_subclass_of($role, $class, FALSE)) {
62 62
         // If `$role` is an instance of a subclass of any role previously assigned to the member that means the new role
63 63
         // is more important and the one already assigned must be removed.
64 64
         unset($this->meta[$this->name][$name]);
@@ -76,8 +76,9 @@  discard block
 block discarded – undo
76 76
    * @param[in] IRole $role A role object.
77 77
    */
78 78
   public function revoke(IRole $role) {
79
-    if ($this->exists($role))
80
-      unset($this->meta[$this->name][$role->getName()]);
79
+    if ($this->exists($role)) {
80
+          unset($this->meta[$this->name][$role->getName()]);
81
+    }
81 82
   }
82 83
 
83 84
 
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.