Passed
Branch master (4540a1)
by Al Amin
07:57
created
Category
src/Storage/Menu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         parent::boot();
93 93
 
94
-        static::creating(function ($menu) {
94
+        static::creating(function($menu) {
95 95
             $menu->position = self::position($menu->parent_id);
96 96
         });
97 97
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
         (new static)->ofCommonStrategicObjective($commonStrategicObjectiveId)
108 108
             ->get()
109
-            ->each(function ($objective, $key) {
109
+            ->each(function($objective, $key) {
110 110
                 $objective->sequence = $key + 1;
111 111
                 $objective->save();
112 112
             });
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
     public function getRouteListAttribute()
139 139
     {
140
-        if (! $this->routes) {
140
+        if (!$this->routes) {
141 141
             return $this->routes;
142 142
         }
143 143
         return implode(', ', $this->routes);
Please login to merge, or discard this patch.
src/Storage/Permission.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 
60 60
     public static function routes()
61 61
     {
62
-        return Cache::remember('routes', now()->addHour(), function () {
62
+        return Cache::remember('routes', now()->addHour(), function() {
63 63
             $filterRoutes = [];
64 64
             $routes = Route::getRoutes();
65 65
             foreach ($routes as $route) {
66
-                if (! self::routeMatch($route)) {
66
+                if (!self::routeMatch($route)) {
67 67
                     continue;
68 68
                 }
69 69
                 $filterRoutes[] = explode_route($route);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
     public static function excludedActionList()
76 76
     {
77
-        return Cache::rememberForever('excluded-action-list', function () {
77
+        return Cache::rememberForever('excluded-action-list', function() {
78 78
             $excluded = collect();
79 79
             $routes = Route::getRoutes();
80 80
             foreach ($routes as $route) {
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
 
89 89
     public static function actions()
90 90
     {
91
-        return Cache::rememberForever('route-actions', function () {
91
+        return Cache::rememberForever('route-actions', function() {
92 92
             $actions = [];
93
-            self::routes()->each(function ($route) use (&$actions) {
93
+            self::routes()->each(function($route) use (&$actions) {
94 94
                 $actions[$route['namespace']][$route['controller']][$route['method']][] = $route['action'];
95 95
             });
96 96
             ksort($actions);
@@ -100,6 +100,6 @@  discard block
 block discarded – undo
100 100
 
101 101
     private static function routeMatch($route)
102 102
     {
103
-        return is_working_route($route) && ! is_excluded_route($route);
103
+        return is_working_route($route) && !is_excluded_route($route);
104 104
     }
105 105
 }
Please login to merge, or discard this patch.
src/Storage/seeds/PcmmMenusTableSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function run()
14 14
     {
15
-        $this->data()->each(function ($data) {
15
+        $this->data()->each(function($data) {
16 16
             Menu::create($data);
17 17
         });
18 18
     }
Please login to merge, or discard this patch.
src/Storage/seeds/PermissionsTableSeeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
      */
14 14
     public function run()
15 15
     {
16
-        Menu::where('parent_id', '>', 0)->get()->each(function ($menu){
17
-            $menu->permissions()->saveMany(factory(Permission::class, mt_rand(1,5))->make());
16
+        Menu::where('parent_id', '>', 0)->get()->each(function($menu) {
17
+            $menu->permissions()->saveMany(factory(Permission::class, mt_rand(1, 5))->make());
18 18
         });
19 19
     }
20 20
 }
Please login to merge, or discard this patch.
src/Storage/factories/PermissionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 use PhpCollective\MenuMaker\Storage\Permission;
16 16
 
17
-$factory->define(Permission::class, function () {
17
+$factory->define(Permission::class, function() {
18 18
     $permission = Permission::routes()->random();
19 19
     return [
20 20
         'namespace'  => $permission['namespace'],
Please login to merge, or discard this patch.
src/Storage/factories/RoleFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use PhpCollective\MenuMaker\Storage\Role;
5 5
 
6
-$factory->define(Role::class, function (Faker $faker) {
6
+$factory->define(Role::class, function(Faker $faker) {
7 7
     return [
8 8
         'name' => $faker->name
9 9
     ];
Please login to merge, or discard this patch.
src/Storage/factories/MenuFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Faker\Generator as Faker;
5 5
 use PhpCollective\MenuMaker\Storage\Menu;
6 6
 
7
-$factory->define(Menu::class, function (Faker $faker) {
7
+$factory->define(Menu::class, function(Faker $faker) {
8 8
     return [
9 9
         'name'   => $faker->word,
10 10
         'alease' => $faker->unique()->slug,
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     ];
16 16
 });
17 17
 
18
-$factory->state(Menu::class, 'section', function ($faker) {
18
+$factory->state(Menu::class, 'section', function($faker) {
19 19
     return [
20 20
         'name'   => $faker->word,
21 21
         'alease' => $faker->unique()->slug,
Please login to merge, or discard this patch.
src/Observers/RoleObserver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      */
38 38
     private function removeCache(Role $group)
39 39
     {
40
-        $group->users->each(function ($user) {
40
+        $group->users->each(function($user) {
41 41
             RemoveUserMenuCache::dispatch($user);
42 42
         });
43 43
     }
Please login to merge, or discard this patch.
src/Observers/MenuObserver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     private function removeUserCache(Menu $menu)
55 55
     {
56 56
         $menu->load('roles', 'roles.users');
57
-        $menu->roles->each(function ($role) {
58
-            $role->users->each(function ($user) {
57
+        $menu->roles->each(function($role) {
58
+            $role->users->each(function($user) {
59 59
                 RemoveUserMenuCache::dispatch($user);
60 60
             });
61 61
         });
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
     private function removeAdminCache()
70 70
     {
71 71
         $admin = Role::with('users')->admin()->first();
72
-        if(! $admin)
72
+        if (!$admin)
73 73
         {
74 74
             return;
75 75
         }
76 76
 
77
-        $admin->users->each(function ($user) {
77
+        $admin->users->each(function($user) {
78 78
             RemoveUserMenuCache::dispatch($user);
79 79
         });
80 80
     }
Please login to merge, or discard this patch.