@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function getScopeRestrictions($subject, string $scope, int $level = null): array |
| 23 | 23 | { |
| 24 | - $scopes = $subject->roles->flatMap(function ($role) use ($scope, $level) { |
|
| 24 | + $scopes = $subject->roles->flatMap(function($role) use ($scope, $level) { |
|
| 25 | 25 | if ($level) { |
| 26 | 26 | $permissions = $role->permissions->where('level', $level); |
| 27 | 27 | } else { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return preg_grep("/^${scope}:/", array_column($permissions->toArray(), 'scope')); |
| 32 | 32 | })->toArray(); |
| 33 | 33 | |
| 34 | - return array_map(function ($scope) { |
|
| 34 | + return array_map(function($scope) { |
|
| 35 | 35 | return explode(':', $scope)[1]; |
| 36 | 36 | }, $scopes); |
| 37 | 37 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function detectScope(string $model) |
| 171 | 171 | { |
| 172 | 172 | return $this->config->get( |
| 173 | - 'mapping.' . $model, |
|
| 173 | + 'mapping.'.$model, |
|
| 174 | 174 | $this->config->get('mapping_default') |
| 175 | 175 | ); |
| 176 | 176 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | if (':*' === substr($scope, -2)) { |
| 234 | 234 | $scope = substr($scope, 0, -2); |
| 235 | 235 | |
| 236 | - return $subject->permissions->sortbyDesc('level')->first(function ($perm) use ($scope) { |
|
| 236 | + return $subject->permissions->sortbyDesc('level')->first(function($perm) use ($scope) { |
|
| 237 | 237 | return preg_match("/^(${scope}$|${scope}:)/", $perm['scope']); |
| 238 | 238 | }); |
| 239 | 239 | } |