Completed
Pull Request — master (#7)
by Jonathan
12:15
created
app/Fields/Uitype/Checkbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
      * @param \Uccello\Core\Models\Module|null $module
60 60
      * @return string|null
61 61
      */
62
-    public function getFormattedValueToSave(Request $request, Field $field, $value, $record=null, ?Domain $domain=null, ?Module $module=null) : ?string
62
+    public function getFormattedValueToSave(Request $request, Field $field, $value, $record = null, ?Domain $domain = null, ?Module $module = null) : ?string
63 63
     {
64 64
         return $value ?? 0;
65 65
     }
Please login to merge, or discard this patch.
app/Fields/Uitype/Range.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
     public function askFieldOptions(\StdClass &$module, \StdClass &$field, InputInterface $input, OutputInterface $output)
37 37
     {
38 38
         // Minimum value
39
-        $field->data->min = (int) $output->ask('What is the minimum value?', 0);
39
+        $field->data->min = (int)$output->ask('What is the minimum value?', 0);
40 40
 
41 41
         // Maximum value
42
-        $field->data->max = (int) $output->ask('What is the maximum value?', 100);
42
+        $field->data->max = (int)$output->ask('What is the maximum value?', 100);
43 43
 
44 44
         // Increment
45
-        $field->data->step = (int) $output->ask('What is the increment?', 1);
45
+        $field->data->step = (int)$output->ask('What is the increment?', 1);
46 46
 
47 47
         // Initial values
48 48
         $field->data->start = $output->ask('Initial values (can be multiple) e.g. [10,30]', '[0]');
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
         // Maximum gap
51 51
         $limit = $output->ask('What is the maximum gap between two values?');
52 52
         if (!is_null($limit)) {
53
-            $field->data->limit = (int) $limit;
53
+            $field->data->limit = (int)$limit;
54 54
         }
55 55
 
56 56
         // Minimum gap
57
-        $margin = (int) $output->ask('What is the minimum gap between two values?');
57
+        $margin = (int)$output->ask('What is the minimum gap between two values?');
58 58
         if (!is_null($margin)) {
59
-            $field->data->margin = (int) $margin;
59
+            $field->data->margin = (int)$margin;
60 60
         }
61 61
     }
62 62
 }
63 63
\ No newline at end of file
Please login to merge, or discard this patch.
app/Fields/Uitype/Month.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function getFormOptions($record, Field $field, Module $module) : array
35 35
     {
36
-        $options['attr'] = ['class' => 'form-control monthpicker'];
36
+        $options[ 'attr' ] = [ 'class' => 'form-control monthpicker' ];
37 37
 
38 38
         return $options;
39 39
     }
Please login to merge, or discard this patch.
app/Fields/Traits/DefaultUitype.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function getFormOptions($record, Field $field, Module $module) : array
26 26
     {
27
-        return [];
27
+        return [ ];
28 28
     }
29 29
 
30 30
     /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @param \Uccello\Core\Models\Module|null $module
71 71
      * @return string|null
72 72
      */
73
-    public function getFormattedValueToSave(Request $request, Field $field, $value, $record=null, ?Domain $domain=null, ?Module $module=null) : ?string
73
+    public function getFormattedValueToSave(Request $request, Field $field, $value, $record = null, ?Domain $domain = null, ?Module $module = null) : ?string
74 74
     {
75 75
         return $value;
76 76
     }
Please login to merge, or discard this patch.
app/Console/Commands/UccelloInstallCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $this->info('Copying login controller...');
72 72
         copy(
73
-            __DIR__ . '/stubs/make/app/Http/Controllers/Auth/LoginController.stub',
73
+            __DIR__.'/stubs/make/app/Http/Controllers/Auth/LoginController.stub',
74 74
             app_path('Http/Controllers/Auth/LoginController.php')
75 75
         );
76 76
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     protected function createDirectories()
122 122
     {
123
-        if (! is_dir(resource_path('views/errors'))) {
123
+        if (!is_dir(resource_path('views/errors'))) {
124 124
             mkdir(resource_path('views/errors'), 0755, true);
125 125
         }
126 126
     }
Please login to merge, or discard this patch.
app/Listeners/User/AfterSaveEventListener.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
         $user = $event->record;
39 39
 
40 40
         $oldPrivileges = $this->getUserPrivileges($event);
41
-        $newPrivileges = [];
41
+        $newPrivileges = [ ];
42 42
 
43
-        $roleIds = (array) $event->request->input('roles');
43
+        $roleIds = (array)$event->request->input('roles');
44 44
 
45
-        foreach($roleIds as $roleId) {
45
+        foreach ($roleIds as $roleId) {
46 46
             $role = Role::find($roleId);
47 47
 
48 48
             if (is_null($role) || $role->domain->id !== $domain->id) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             }
51 51
 
52 52
             // Create a new privilege and ignore duplicates
53
-            $newPrivileges[] = Privilege::firstOrCreate([
53
+            $newPrivileges[ ] = Privilege::firstOrCreate([
54 54
                 'domain_id' => $domain->id,
55 55
                 'role_id' => $role->id,
56 56
                 'user_id' => $user->id
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
      */
70 70
     protected function getUserPrivileges(AfterSaveEvent $event) : array
71 71
     {
72
-        $privileges = [];
72
+        $privileges = [ ];
73 73
 
74 74
         $domain = $event->domain;
75 75
         $user = $event->record;
76 76
 
77 77
         foreach ($user->privileges->where('domain_id', $domain->id) as $privilege) {
78
-            $privileges[] = $privilege;
78
+            $privileges[ ] = $privilege;
79 79
         }
80 80
 
81 81
         return $privileges;
Please login to merge, or discard this patch.
app/Listeners/Profile/AfterSaveEventListener.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
         $user = $this->auth->user();
42 42
 
43 43
         $oldPermissions = $this->getProfilePermissions($event);
44
-        $newPermissions = [];
44
+        $newPermissions = [ ];
45 45
 
46
-        $permissions = (array) $request->input('permissions');
46
+        $permissions = (array)$request->input('permissions');
47 47
 
48 48
         foreach ($permissions as $moduleName => $capabilities) {
49 49
             // Retrieve module from name
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 }
65 65
 
66 66
                 // Create a new permisison and ignore duplicates
67
-                $newPermissions[] = Permission::firstOrCreate([
67
+                $newPermissions[ ] = Permission::firstOrCreate([
68 68
                     'profile_id' => $profile->id,
69 69
                     'module_id' => $module->id,
70 70
                     'capability_id' => $capability->id
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function getProfilePermissions(AfterSaveEvent $event) : array
86 86
     {
87
-        $permissions = [];
87
+        $permissions = [ ];
88 88
 
89 89
         $domain = $event->domain;
90 90
         $profile = $event->record;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         foreach ($profilePermissions as $permission) {
96 96
             if ($user->canAdmin($domain, $permission->module)) {
97
-                $permissions[] = $permission;
97
+                $permissions[ ] = $permission;
98 98
             }
99 99
         }
100 100
 
Please login to merge, or discard this patch.
app/Listeners/Role/AfterSaveEventListener.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
         $role = $event->record;
38 38
 
39 39
         $oldProfileIds = $role->profiles->pluck('id')->toArray();
40
-        $selectedProfileIds = (array) $event->request->input('profiles');
40
+        $selectedProfileIds = (array)$event->request->input('profiles');
41 41
 
42 42
         // Note: All selected profiles - Old profiles = New profiles
43 43
         $newProfileIds = array_diff($selectedProfileIds, $oldProfileIds);
Please login to merge, or discard this patch.
app/Providers/EventServiceProvider.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,29 +9,29 @@
 block discarded – undo
9 9
  */
10 10
 class EventServiceProvider extends DefaultEventServiceProvider
11 11
 {
12
-  /**
12
+    /**
13 13
      * The event listener mappings for the application.
14 14
      *
15 15
      * @var array
16 16
      */
17 17
     protected $listen = [
18
-      'Uccello\Core\Events\AfterSaveEvent' => [
19
-          'Uccello\Core\Listeners\Profile\AfterSaveEventListener',
20
-          'Uccello\Core\Listeners\Role\AfterSaveEventListener',
21
-          'Uccello\Core\Listeners\User\AfterSaveEventListener',
22
-          'Uccello\Core\Listeners\Domain\AfterSaveEventListener',
23
-      ],
24
-  ];
18
+        'Uccello\Core\Events\AfterSaveEvent' => [
19
+            'Uccello\Core\Listeners\Profile\AfterSaveEventListener',
20
+            'Uccello\Core\Listeners\Role\AfterSaveEventListener',
21
+            'Uccello\Core\Listeners\User\AfterSaveEventListener',
22
+            'Uccello\Core\Listeners\Domain\AfterSaveEventListener',
23
+        ],
24
+    ];
25 25
 
26
-  /**
27
-   * Register any events for your application.
28
-   *
29
-   * @return void
30
-   */
31
-  public function boot()
32
-  {
33
-      parent::boot();
26
+    /**
27
+     * Register any events for your application.
28
+     *
29
+     * @return void
30
+     */
31
+    public function boot()
32
+    {
33
+        parent::boot();
34 34
 
35
-      //
36
-  }
35
+        //
36
+    }
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.