Skip to content

Commit

Permalink
Improved doc, add extra parameter to role objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Samshal committed Jun 3, 2016
1 parent 85c09f8 commit 3053fe6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -54,3 +54,4 @@ Creating an ACL component is as easy as instantiating `Samshal\Acl`. The constru
$acl = new Acl();
```

#### Adding objects (**Roles**, **Permission** and **Resources**) to the ACL.
16 changes: 15 additions & 1 deletion src/Role/DefaultRole.php
Expand Up @@ -26,12 +26,18 @@ class DefaultRole implements RoleInterface, ObjectInterface
*/
protected $roleName;

/**
* @var string
*/
protected $roleDescription;

/**
* {@inheritdoc}
*/
public function __construct(string $roleName)
public function __construct(string $roleName, string $roleDescription="")
{
$this->roleName = $roleName;
$this->roleDescription = $roleDescription;
}

/**
Expand All @@ -42,6 +48,14 @@ public function getName() : string
return $this->roleName;
}

/**
* {@inheritdoc}
*/
public function getDescription() : string
{
return $this->roleDescription;
}

/**
* Returns the roleName when this class is treated as a string.
*/
Expand Down
6 changes: 6 additions & 0 deletions src/Role/RoleInterface.php
Expand Up @@ -19,4 +19,10 @@
*/
interface RoleInterface
{
/**
* Returns the descriptionof a role object
*
* @return string
*/
public function getDescription() : string;
}

0 comments on commit 3053fe6

Please sign in to comment.