Skip to content

Commit

Permalink
Refactoring (#2)
Browse files Browse the repository at this point in the history
* php 7.1 migration

* refactoring
  • Loading branch information
n3vrax authored Mar 7, 2017
1 parent 4f73450 commit 9d71e1b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 8 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 0.1.0 - 2017-03-07

Initial tagged release

### Added
* Everything

### Deprecated
* Nothing

### Removed
* Nothing

### Fixed
* Nothing
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
Expand All @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.6-dev"
"dev-master": "0.2-dev"
}
}
}
8 changes: 5 additions & 3 deletions src/AuthorizationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization;

/**
Expand All @@ -16,10 +18,10 @@
interface AuthorizationInterface
{
/**
* @param $permission
* @param string $permission
* @param array $roles
* @param null $context
* @param mixed|null $context
* @return bool
*/
public function isGranted($permission, array $roles = [], $context = null);
public function isGranted(string $permission, array $roles = [], $context = null): bool;
}
2 changes: 2 additions & 0 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization\Exception;

/**
Expand Down
9 changes: 8 additions & 1 deletion src/Exception/ForbiddenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization\Exception;

use Exception;

/**
* Class ForbiddenException
* @package Dot\Authorization\Exception
*/
class ForbiddenException extends \Exception implements ExceptionInterface
{

public function __construct($message = "", $code = 403, Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
}
2 changes: 2 additions & 0 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization\Exception;

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Identity/IdentityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization\Identity;

use Dot\Authorization\Role\RoleInterface;
Expand All @@ -20,5 +22,5 @@ interface IdentityInterface
/**
* @return string[]|RoleInterface[]
*/
public function getRoles();
public function getRoles(): array;
}
4 changes: 3 additions & 1 deletion src/Role/RoleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Time: 7:49 PM
*/

declare(strict_types = 1);

namespace Dot\Authorization\Role;

/**
Expand All @@ -18,5 +20,5 @@ interface RoleInterface
/**
* @return string
*/
public function getName();
public function getName(): string;
}

0 comments on commit 9d71e1b

Please sign in to comment.