Skip to content

Commit

Permalink
Merge pull request #77 from mostafamaklad/v1.9
Browse files Browse the repository at this point in the history
V1.9.0
  • Loading branch information
mostafamaklad authored Nov 14, 2018
2 parents 4ea8090 + 134d06d commit 277238f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All Notable changes to `laravel-permission-mongodb` will be documented in this file.

## 1.9.0 - 2018-09-14

### Fixed
- Fix wrong BelongsTo relationship
- Config cleanup
- Fixes for Lumen 5.6 compatibility
- Fix classes resolution to config values
- Fix permissions via roles
- Fixed detection of Lumen

### Added
- Add scrutinizer code intelligence

### Changed
- Loose typing definitions for BelongsToMany

## 1.8.2 - 2018-08-14

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/MakladException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MakladException extends InvalidArgumentException
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 0, Throwable $previous = null)
public function __construct(string $message = null, int $code = 0, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
10 changes: 7 additions & 3 deletions src/Exceptions/UnauthorizedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ class UnauthorizedException extends HttpException
* UnauthorizedException constructor.
*
* @param $statusCode
* @param null $message
* @param string $message
* @param array $requiredRoles
* @param array $requiredPermissions
*/
public function __construct($statusCode, $message = null, $requiredRoles = [], $requiredPermissions = [])
{
public function __construct(
$statusCode,
string $message = null,
array $requiredRoles = [],
array $requiredPermissions = []
) {
parent::__construct($statusCode, $message);

if (\config('permission.log_registration_exception')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/UnauthorizedPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class UnauthorizedPermission extends UnauthorizedException
* UnauthorizedPermission constructor.
*
* @param $statusCode
* @param null $message
* @param string $message
* @param array $requiredPermissions
*/
public function __construct($statusCode, $message = null, $requiredPermissions = [])
public function __construct($statusCode, string $message = null, array $requiredPermissions = [])
{
parent::__construct($statusCode, $message, [], $requiredPermissions);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/UnauthorizedRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class UnauthorizedRole extends UnauthorizedException
* UnauthorizedPermission constructor.
*
* @param $statusCode
* @param null $message
* @param string $message
* @param array $requiredRoles
*/
public function __construct($statusCode, $message = null, $requiredRoles = [])
public function __construct($statusCode, string $message = null, array $requiredRoles = [])
{
parent::__construct($statusCode, $message, $requiredRoles);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Traits/HasPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Maklad\Permission\Guard;
use Maklad\Permission\Helpers;
use Maklad\Permission\Models\Role;
use Maklad\Permission\Models\PermissionRole;
use Maklad\Permission\PermissionRegistrar;

/**
Expand Down Expand Up @@ -317,7 +316,7 @@ public function getDirectPermissions(): Collection
* Scope the model query to certain permissions only.
*
* @param Builder $query
* @param string|array|Permission|Collection $permissions
* @param string|array|\Maklad\Permission\Contracts\PermissionInterface|Collection $permissions
*
* @return Builder
*/
Expand Down

0 comments on commit 277238f

Please sign in to comment.