@@ -19,10 +19,10 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | interface RoleInterface |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * Returns the description of a role object |
|
| 24 | - * |
|
| 25 | - * @return string |
|
| 26 | - */ |
|
| 27 | - public function getDescription() : string; |
|
| 22 | + /** |
|
| 23 | + * Returns the description of a role object |
|
| 24 | + * |
|
| 25 | + * @return string |
|
| 26 | + */ |
|
| 27 | + public function getDescription() : string; |
|
| 28 | 28 | } |
@@ -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 |
@@ -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 |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * {@inheritdoc} |
| 30 | 30 | */ |
| 31 | - public function __construct(string $roleName, string $roleDescription="") |
|
| 31 | + public function __construct(string $roleName, string $roleDescription = "") |
|
| 32 | 32 | { |
| 33 | 33 | $this->roleName = $roleName; |
| 34 | 34 | $this->roleDescription = $roleDescription; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @throws Exception |
| 53 | 53 | */ |
| 54 | - public function allow(string $role, string $permission, string $resource, ?bool $status=null): void; |
|
| 54 | + public function allow(string $role, string $permission, string $resource, ?bool $status = null): void; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Change the status option of an assigned permission to false |
@@ -286,7 +286,7 @@ |
||
| 286 | 286 | * |
| 287 | 287 | * @throws Exception |
| 288 | 288 | */ |
| 289 | - public function allow(string $role, string $permission, string $resource, ?bool $status=null): void |
|
| 289 | + public function allow(string $role, string $permission, string $resource, ?bool $status = null): void |
|
| 290 | 290 | { |
| 291 | 291 | $status = $status ?? true; |
| 292 | 292 | if (!$this->roleRegistry->exists($role)) { |
@@ -237,16 +237,13 @@ |
||
| 237 | 237 | if ($object instanceof RoleInterface) |
| 238 | 238 | { |
| 239 | 239 | $this->addRole((string)$object); |
| 240 | - } |
|
| 241 | - else if ($object instanceof ResourceInterface) |
|
| 240 | + } else if ($object instanceof ResourceInterface) |
|
| 242 | 241 | { |
| 243 | 242 | $this->addResource((string)$object); |
| 244 | - } |
|
| 245 | - else if ($object instanceof PermissionInterface) |
|
| 243 | + } else if ($object instanceof PermissionInterface) |
|
| 246 | 244 | { |
| 247 | 245 | $this->addPermission((string)$object); |
| 248 | - } |
|
| 249 | - else { |
|
| 246 | + } else { |
|
| 250 | 247 | throw new Exception( |
| 251 | 248 | sprintf( |
| 252 | 249 | "%s must implement one of RoleInterface, '. |
@@ -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 |
@@ -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 |
@@ -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 |