@@ -41,7 +41,7 @@ |
||
41 | 41 | private function normalizeModel($target, array $model): array |
42 | 42 | { |
43 | 43 | $model = $this->normalizeInput($model); |
44 | - $mapper = function ($model) use ($target) { |
|
44 | + $mapper = function($model) use ($target) { |
|
45 | 45 | return "eloquent.{$target}: {$model}"; |
46 | 46 | }; |
47 | 47 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $guardName = $model->guard_name ?? null; |
19 | 19 | } |
20 | 20 | |
21 | - if (! isset($guardName)) { |
|
21 | + if (!isset($guardName)) { |
|
22 | 22 | $class = is_object($model) ? get_class($model) : $model; |
23 | 23 | |
24 | 24 | $guardName = (new \ReflectionClass($class))->getDefaultProperties()['guard_name'] ?? null; |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | return collect(config('auth.guards')) |
32 | - ->map(function ($guard) { |
|
33 | - if (! isset($guard['provider'])) { |
|
32 | + ->map(function($guard) { |
|
33 | + if (!isset($guard['provider'])) { |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | 37 | return config("auth.providers.{$guard['provider']}.model"); |
38 | 38 | }) |
39 | - ->filter(function ($model) use ($class) { |
|
39 | + ->filter(function($model) use ($class) { |
|
40 | 40 | return $class === $model; |
41 | 41 | }) |
42 | 42 | ->keys(); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | }; |
72 | 72 | } |
73 | 73 | |
74 | - return function () { |
|
74 | + return function() { |
|
75 | 75 | }; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | \ No newline at end of file |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $role = static::where('id', $id)->where('guard_name', $guardName)->first(); |
18 | 18 | |
19 | - if (! $role) { |
|
19 | + if (!$role) { |
|
20 | 20 | throw RoleDoesNotExist::withId($id); |
21 | 21 | } |
22 | 22 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $role = static::where('name', $name)->where('guard_name', $guardName)->first(); |
31 | 31 | |
32 | - if (! $role) { |
|
32 | + if (!$role) { |
|
33 | 33 | throw RoleDoesNotExist::named($name); |
34 | 34 | } |
35 | 35 |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | { |
14 | 14 | $roles = collect($roles) |
15 | 15 | ->flatten() |
16 | - ->map(function ($role) { |
|
16 | + ->map(function($role) { |
|
17 | 17 | return $this->getStoredRole($role); |
18 | 18 | }) |
19 | - ->each(function ($role) { |
|
19 | + ->each(function($role) { |
|
20 | 20 | $this->ensureModelSharesGuard($role); |
21 | 21 | }) |
22 | 22 | ->all(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | protected function ensureModelSharesGuard($roleOrPermission) |
101 | 101 | { |
102 | - if (! $this->getGuardNames()->contains($roleOrPermission->guard_name)) { |
|
102 | + if (!$this->getGuardNames()->contains($roleOrPermission->guard_name)) { |
|
103 | 103 | throw GuardDoesNotMatch::create($roleOrPermission->guard_name, $this->getGuardNames()); |
104 | 104 | } |
105 | 105 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | return explode('|', $pipeString); |
120 | 120 | } |
121 | 121 | |
122 | - if (! in_array($quoteCharacter, ["'", '"'])) { |
|
122 | + if (!in_array($quoteCharacter, ["'", '"'])) { |
|
123 | 123 | return explode('|', $pipeString); |
124 | 124 | } |
125 | 125 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | private function defineGates(): void |
33 | 33 | { |
34 | - Gate::define('heyman.youShouldHaveRole', function ($user, $role) { |
|
34 | + Gate::define('heyman.youShouldHaveRole', function($user, $role) { |
|
35 | 35 | return $user->hasRole($role); |
36 | 36 | }); |
37 | 37 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $tableNames['roles'] = 'roles'; |
19 | 19 | $tableNames['model_has_roles'] = 'model_has_roles'; |
20 | 20 | |
21 | - Schema::create($tableNames['roles'], function (Blueprint $table) { |
|
21 | + Schema::create($tableNames['roles'], function(Blueprint $table) { |
|
22 | 22 | $table->increments('id'); |
23 | 23 | $table->string('name'); |
24 | 24 | $table->string('guard_name'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | }); |
27 | 27 | |
28 | 28 | |
29 | - Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames) { |
|
29 | + Schema::create($tableNames['model_has_roles'], function(Blueprint $table) use ($tableNames) { |
|
30 | 30 | $table->unsignedInteger('role_id'); |
31 | 31 | $table->morphs('model'); |
32 | 32 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function whenYouVisitUrl(...$url) |
14 | 14 | { |
15 | - $removeSlash = function ($url) { |
|
15 | + $removeSlash = function($url) { |
|
16 | 16 | return ltrim($url, "/"); |
17 | 17 | }; |
18 | 18 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function whenYouCallAction(...$action) |
38 | 38 | { |
39 | - $addNamespace = function ($action) { |
|
39 | + $addNamespace = function($action) { |
|
40 | 40 | if ($action = ltrim($action, '\\')) { |
41 | 41 | return $action; |
42 | 42 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | private function normalizeView(array $views): array |
32 | 32 | { |
33 | 33 | $views = $this->normalizeInput($views); |
34 | - $mapper = function ($view) { |
|
34 | + $mapper = function($view) { |
|
35 | 35 | $this->checkViewExists($view); |
36 | 36 | return 'creating: '.\Illuminate\View\ViewName::normalize($view); |
37 | 37 | }; |