@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types=1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | /** |
4 | 4 | * This file is part of the Samshal\Acl library |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->addPermission((string)$object); |
233 | 233 | } |
234 | 234 | else { |
235 | - throw new Exception("$object must implement one of RoleInterface, " . |
|
235 | + throw new Exception("$object must implement one of RoleInterface, ". |
|
236 | 236 | "ResourceInterface and PermissionInterface"); |
237 | 237 | } |
238 | 238 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * |
262 | 262 | * @throws Exception |
263 | 263 | */ |
264 | - public function allow(string $role, string $permission, string $resource, ?bool $status=null): void |
|
264 | + public function allow(string $role, string $permission, string $resource, ?bool $status = null): void |
|
265 | 265 | { |
266 | 266 | $status = $status ?? true; |
267 | 267 | if (!$this->roleRegistry->exists($role)) { |
@@ -222,16 +222,13 @@ |
||
222 | 222 | if ($object instanceof RoleInterface) |
223 | 223 | { |
224 | 224 | $this->addRole((string)$object); |
225 | - } |
|
226 | - elseif ($object instanceof ResourceInterface) |
|
225 | + } elseif ($object instanceof ResourceInterface) |
|
227 | 226 | { |
228 | 227 | $this->addResource((string)$object); |
229 | - } |
|
230 | - elseif ($object instanceof PermissionInterface) |
|
228 | + } elseif ($object instanceof PermissionInterface) |
|
231 | 229 | { |
232 | 230 | $this->addPermission((string)$object); |
233 | - } |
|
234 | - else { |
|
231 | + } else { |
|
235 | 232 | throw new Exception("$object must implement one of RoleInterface, " . |
236 | 233 | "ResourceInterface and PermissionInterface"); |
237 | 234 | } |