@@ -1,4 +1,4 @@ discard block |
||
| 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 |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * @throws \Exception |
| 318 | 318 | * @return void |
| 319 | 319 | */ |
| 320 | - public function allow(string $role, string $permission, string $resource, bool $status=null) |
|
| 320 | + public function allow(string $role, string $permission, string $resource, bool $status = null) |
|
| 321 | 321 | { |
| 322 | 322 | $status = $status ?? true; |
| 323 | 323 | if (!$this->roleRegistry->exists($role)) { |
@@ -262,16 +262,13 @@ |
||
| 262 | 262 | if ($object instanceof RoleInterface) |
| 263 | 263 | { |
| 264 | 264 | $this->addRole((string)$object); |
| 265 | - } |
|
| 266 | - else if ($object instanceof ResourceInterface) |
|
| 265 | + } else if ($object instanceof ResourceInterface) |
|
| 267 | 266 | { |
| 268 | 267 | $this->addResource((string)$object); |
| 269 | - } |
|
| 270 | - else if ($object instanceof PermissionInterface) |
|
| 268 | + } else if ($object instanceof PermissionInterface) |
|
| 271 | 269 | { |
| 272 | 270 | $this->addPermission((string)$object); |
| 273 | - } |
|
| 274 | - else { |
|
| 271 | + } else { |
|
| 275 | 272 | throw new \Exception( |
| 276 | 273 | sprintf( |
| 277 | 274 | "%s must implement one of RoleInterface, '. |