@@ -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 | } |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | public static function getScopeRestrictions($subject, string $scope): array |
| 251 | 251 | { |
| 252 | - $scopes = $subject->roles->flatMap(function ($role) use ($scope) { |
|
| 252 | + $scopes = $subject->roles->flatMap(function($role) use ($scope) { |
|
| 253 | 253 | return preg_grep("/^${scope}:/", array_column($role->permissions->toArray(), 'scope')); |
| 254 | 254 | })->toArray(); |
| 255 | 255 | |
| 256 | - return array_map(function ($scope) { |
|
| 256 | + return array_map(function($scope) { |
|
| 257 | 257 | return explode(':', $scope)[1]; |
| 258 | 258 | }, $scopes); |
| 259 | 259 | } |