GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#204)
by
unknown
06:45
created
src/Form/Element/Select.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     /**
24 24
      * @var array
25 25
      */
26
-    protected $options = [];
26
+    protected $options = [ ];
27 27
 
28 28
     /**
29 29
      * @var bool
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     /**
44 44
      * @var array
45 45
      */
46
-    protected $exclude = [];
46
+    protected $exclude = [ ];
47 47
 
48 48
     /**
49 49
      * @var string|null
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * @var array
55 55
      */
56
-    protected $fetchColumns = [];
56
+    protected $fetchColumns = [ ];
57 57
 
58 58
     /**
59 59
      * @var function|\Closure|object callable
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param string|null $label
66 66
      * @param array|Model $options
67 67
      */
68
-    public function __construct($path, $label = null, $options = [])
68
+    public function __construct($path, $label = null, $options = [ ])
69 69
     {
70 70
         parent::__construct($path, $label);
71 71
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $modelForOptions = app($modelForOptions);
97 97
         }
98 98
 
99
-        if (! ($modelForOptions instanceof Model)) {
99
+        if (!($modelForOptions instanceof Model)) {
100 100
             throw new SelectException('Class must be instanced of Illuminate\Database\Eloquent\Model');
101 101
         }
102 102
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function getOptions()
132 132
     {
133
-        if (! is_null($this->getModelForOptions()) && ! is_null($this->getDisplay())) {
133
+        if (!is_null($this->getModelForOptions()) && !is_null($this->getDisplay())) {
134 134
             $this->loadOptions();
135 135
         }
136 136
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function setFetchColumns($columns)
239 239
     {
240
-        if (! is_array($columns)) {
240
+        if (!is_array($columns)) {
241 241
             $columns = func_get_args();
242 242
         }
243 243
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function exclude($keys)
300 300
     {
301
-        if (! is_array($keys)) {
301
+        if (!is_array($keys)) {
302 302
             $keys = func_get_args();
303 303
         }
304 304
 
@@ -344,13 +344,13 @@  discard block
 block discarded – undo
344 344
         ];
345 345
 
346 346
         if ($this->isNullable()) {
347
-            $attributes['data-nullable'] = 'true';
347
+            $attributes[ 'data-nullable' ] = 'true';
348 348
         }
349 349
 
350 350
         $options = $this->getOptions();
351 351
 
352 352
         if ($this->isNullable()) {
353
-            $options = [null => trans('sleeping_owl::lang.select.nothing')] + $options;
353
+            $options = [ null => trans('sleeping_owl::lang.select.nothing') ] + $options;
354 354
         }
355 355
 
356 356
         $options = array_except($options, $this->exclude);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      */
368 368
     protected function loadOptions()
369 369
     {
370
-        $repository = app(RepositoryInterface::class, [$this->getModelForOptions()]);
370
+        $repository = app(RepositoryInterface::class, [ $this->getModelForOptions() ]);
371 371
 
372 372
         $key = $repository->getModel()->getKeyName();
373 373
 
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
         }
379 379
 
380 380
         if (count($this->fetchColumns) > 0) {
381
-            $columns = array_merge([$key], $this->fetchColumns);
381
+            $columns = array_merge([ $key ], $this->fetchColumns);
382 382
             $options->select($columns);
383 383
         }
384 384
 
385 385
         // call the pre load options query preparer if has be set
386
-        if (! is_null($preparer = $this->getLoadOptionsQueryPreparer())) {
386
+        if (!is_null($preparer = $this->getLoadOptionsQueryPreparer())) {
387 387
             $options = $preparer($this, $options);
388 388
         }
389 389
 
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 
401 401
             // iterate for all options and redefine it as
402 402
             // list of KEY and TEXT pair
403
-            $options = array_map(function ($opt) use ($key, $makeDisplay) {
403
+            $options = array_map(function($opt) use ($key, $makeDisplay) {
404 404
                 // get the KEY and make the display text
405
-                return [data_get($opt, $key), $makeDisplay($opt)];
405
+                return [ data_get($opt, $key), $makeDisplay($opt) ];
406 406
             }, $options);
407 407
 
408 408
             // take options as array with KEY => VALUE pair
Please login to merge, or discard this patch.
src/Form/Element/Images.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
         $name = $this->getName();
12 12
         $value = Request::input($name, '');
13 13
 
14
-        if (! empty($value)) {
14
+        if (!empty($value)) {
15 15
             $value = explode(',', $value);
16 16
         } else {
17
-            $value = [];
17
+            $value = [ ];
18 18
         }
19 19
 
20
-        Request::merge([$name => $value]);
20
+        Request::merge([ $name => $value ]);
21 21
         parent::save();
22 22
     }
23 23
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $value = parent::getValue();
30 30
         if (is_null($value)) {
31
-            $value = [];
31
+            $value = [ ];
32 32
         }
33 33
 
34 34
         if (is_string($value)) {
Please login to merge, or discard this patch.
src/Navigation/Page.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function getModelConfiguration()
33 33
     {
34
-        if (! $this->hasModel()) {
34
+        if (!$this->hasModel()) {
35 35
             return;
36 36
         }
37 37
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function hasModel()
45 45
     {
46
-        return ! is_null($this->model) and class_exists($this->model);
46
+        return !is_null($this->model) and class_exists($this->model);
47 47
     }
48 48
 
49 49
     /**
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function getAccessLogic()
85 85
     {
86
-        if (! is_callable($this->accessLogic)) {
86
+        if (!is_callable($this->accessLogic)) {
87 87
             if ($this->hasModel()) {
88
-                return function () {
88
+                return function() {
89 89
                     return $this->getModelConfiguration()->isDisplayable();
90 90
                 };
91 91
             }
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
     public function render($view = null)
103 103
     {
104 104
         $data = $this->toArray();
105
-        $data['pages'] = $this->getPages();
105
+        $data[ 'pages' ] = $this->getPages();
106 106
 
107
-        if (! is_null($view)) {
107
+        if (!is_null($view)) {
108 108
             return view($view, $data)->render();
109 109
         }
110 110
 
Please login to merge, or discard this patch.
src/Providers/AdminSectionsServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     /**
10 10
      * @var array
11 11
      */
12
-    protected $sections = [];
12
+    protected $sections = [ ];
13 13
 
14 14
     /**
15 15
      * Register the service provider.
Please login to merge, or discard this patch.
src/Providers/AdminServiceProvider.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function register()
22 22
     {
23
-        $this->app->singleton('sleeping_owl', function () {
23
+        $this->app->singleton('sleeping_owl', function() {
24 24
             return new Admin();
25 25
         });
26 26
 
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
         $this->registerWysiwyg();
31 31
         $this->registerAliases();
32 32
 
33
-        $this->app->booted(function () {
33
+        $this->app->booted(function() {
34 34
             $this->registerCustomRoutes();
35 35
             $this->registerDefaultRoutes();
36 36
             $this->registerNavigationFile();
37 37
         });
38 38
 
39
-        ModelConfigurationManager::setEventDispatcher($this->app['events']);
39
+        ModelConfigurationManager::setEventDispatcher($this->app[ 'events' ]);
40 40
     }
41 41
 
42 42
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     protected function getConfig($key)
48 48
     {
49
-        return $this->app['config']->get('sleeping_owl.'.$key);
49
+        return $this->app[ 'config' ]->get('sleeping_owl.'.$key);
50 50
     }
51 51
 
52 52
     /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     protected function getBootstrapPath($path = null)
58 58
     {
59
-        if (! is_null($path)) {
59
+        if (!is_null($path)) {
60 60
             $path = DIRECTORY_SEPARATOR.$path;
61 61
         }
62 62
 
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function boot()
67 67
     {
68
-        $this->app->singleton('sleeping_owl.template', function () {
69
-            return $this->app['sleeping_owl']->template();
68
+        $this->app->singleton('sleeping_owl.template', function() {
69
+            return $this->app[ 'sleeping_owl' ]->template();
70 70
         });
71 71
 
72 72
         $this->registerBootstrap();
73 73
 
74
-        $this->registerRoutes(function () {
75
-            $this->app['router']->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($route) {
74
+        $this->registerRoutes(function() {
75
+            $this->app[ 'router' ]->group([ 'as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers' ], function($route) {
76 76
                 $route->get('assets/admin.scripts', [
77 77
                     'as'   => 'scripts',
78 78
                     'uses' => 'AdminController@getScripts',
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
         $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class);
91 91
         $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class);
92 92
 
93
-        $this->app->singleton('sleeping_owl.navigation', function () {
93
+        $this->app->singleton('sleeping_owl.navigation', function() {
94 94
             return new \SleepingOwl\Admin\Navigation();
95 95
         });
96 96
     }
97 97
 
98 98
     protected function registerWysiwyg()
99 99
     {
100
-        $this->app->singleton('sleeping_owl.wysiwyg', function () {
100
+        $this->app->singleton('sleeping_owl.wysiwyg', function() {
101 101
             return new \SleepingOwl\Admin\Wysiwyg\Manager();
102 102
         });
103 103
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     {
110 110
         $directory = $this->getBootstrapPath();
111 111
 
112
-        if (! is_dir($directory)) {
112
+        if (!is_dir($directory)) {
113 113
             return;
114 114
         }
115 115
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             ->name('/^.+\.php$/')
119 119
             ->notName('routes.php')
120 120
             ->notName('navigation.php')
121
-            ->in($directory)->sort(function ($a) {
121
+            ->in($directory)->sort(function($a) {
122 122
                 return $a->getFilename() != 'bootstrap.php';
123 123
             });
124 124
 
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 
130 130
     protected function registerAliases()
131 131
     {
132
-        AliasLoader::getInstance(config('sleeping_owl.aliases', []));
132
+        AliasLoader::getInstance(config('sleeping_owl.aliases', [ ]));
133 133
     }
134 134
 
135 135
     protected function registerCustomRoutes()
136 136
     {
137 137
         if (file_exists($file = $this->getBootstrapPath('routes.php'))) {
138
-            $this->registerRoutes(function () use ($file) {
138
+            $this->registerRoutes(function() use ($file) {
139 139
                 require $file;
140 140
             });
141 141
         }
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 
144 144
     protected function registerDefaultRoutes()
145 145
     {
146
-        $this->registerRoutes(function () {
147
-            $this->app['router']->pattern('adminModelId', '[a-zA-Z0-9_-]+');
146
+        $this->registerRoutes(function() {
147
+            $this->app[ 'router' ]->pattern('adminModelId', '[a-zA-Z0-9_-]+');
148 148
 
149
-            $aliases = $this->app['sleeping_owl']->modelAliases();
149
+            $aliases = $this->app[ 'sleeping_owl' ]->modelAliases();
150 150
 
151 151
             if (count($aliases) > 0) {
152
-                $this->app['router']->pattern('adminModel', implode('|', $aliases));
152
+                $this->app[ 'router' ]->pattern('adminModel', implode('|', $aliases));
153 153
 
154
-                $this->app['router']->bind('adminModel', function ($model, \Illuminate\Routing\Route $route) use ($aliases) {
154
+                $this->app[ 'router' ]->bind('adminModel', function($model, \Illuminate\Routing\Route $route) use ($aliases) {
155 155
                     $class = array_search($model, $aliases);
156 156
 
157 157
                     if ($class === false) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                     }
160 160
 
161 161
                     /** @var ModelConfiguration $model */
162
-                    $model = $this->app['sleeping_owl']->getModel($class);
162
+                    $model = $this->app[ 'sleeping_owl' ]->getModel($class);
163 163
 
164 164
                     if ($model->hasCustomControllerClass()) {
165 165
                         list($controller, $action) = explode('@', $route->getActionName(), 2);
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
      */
189 189
     protected function registerRoutes(\Closure $callback)
190 190
     {
191
-        $this->app['router']->group([
191
+        $this->app[ 'router' ]->group([
192 192
             'prefix' => $this->getConfig('url_prefix'),
193 193
             'middleware' => $this->getConfig('middleware'),
194
-        ], function () use ($callback) {
194
+        ], function() use ($callback) {
195 195
             call_user_func($callback);
196 196
         });
197 197
     }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $items = include $navigation;
203 203
 
204 204
             if (is_array($items)) {
205
-                $this->app['sleeping_owl.navigation']->setFromArray($items);
205
+                $this->app[ 'sleeping_owl.navigation' ]->setFromArray($items);
206 206
             }
207 207
         }
208 208
     }
Please login to merge, or discard this patch.
src/Providers/SleepingOwlServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     public function registerProviders()
40 40
     {
41
-        foreach (config('sleeping_owl.providers', []) as $providerClass) {
41
+        foreach (config('sleeping_owl.providers', [ ]) as $providerClass) {
42 42
             $this->app->register($providerClass);
43 43
         }
44 44
     }
Please login to merge, or discard this patch.
src/Providers/AliasesServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             'select' => \SleepingOwl\Admin\Display\Column\Filter\Select::class,
28 28
         ]);
29 29
 
30
-        $this->app->singleton('sleeping_owl.column_filter', function () use ($alias) {
30
+        $this->app->singleton('sleeping_owl.column_filter', function() use ($alias) {
31 31
             return $alias;
32 32
         });
33 33
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             'tree'            => \SleepingOwl\Admin\Display\DisplayTree::class,
44 44
         ]);
45 45
 
46
-        $this->app->singleton('sleeping_owl.display', function () use ($alias) {
46
+        $this->app->singleton('sleeping_owl.display', function() use ($alias) {
47 47
             return $alias;
48 48
         });
49 49
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             'treeControl' => \SleepingOwl\Admin\Display\Column\TreeControl::class,
69 69
         ]);
70 70
 
71
-        $this->app->singleton('sleeping_owl.table.column', function () use ($alias) {
71
+        $this->app->singleton('sleeping_owl.table.column', function() use ($alias) {
72 72
             return $alias;
73 73
         });
74 74
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             'checkbox'    => \SleepingOwl\Admin\Display\Column\Editable\Checkbox::class,
80 80
         ]);
81 81
 
82
-        $this->app->singleton('sleeping_owl.table.column.editable', function () use ($alias) {
82
+        $this->app->singleton('sleeping_owl.table.column.editable', function() use ($alias) {
83 83
             return $alias;
84 84
         });
85 85
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             'html'        => \SleepingOwl\Admin\Form\Element\Html::class,
112 112
         ]);
113 113
 
114
-        $this->app->singleton('sleeping_owl.form.element', function () use ($alias) {
114
+        $this->app->singleton('sleeping_owl.form.element', function() use ($alias) {
115 115
             return $alias;
116 116
         });
117 117
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             'panel'  => \SleepingOwl\Admin\Form\FormPanel::class,
125 125
         ]);
126 126
 
127
-        $this->app->singleton('sleeping_owl.form', function () use ($alias) {
127
+        $this->app->singleton('sleeping_owl.form', function() use ($alias) {
128 128
             return $alias;
129 129
         });
130 130
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             'related' => \SleepingOwl\Admin\Display\Filter\FilterRelated::class,
139 139
         ]);
140 140
 
141
-        $this->app->singleton('sleeping_owl.display.filter', function () use ($alias) {
141
+        $this->app->singleton('sleeping_owl.display.filter', function() use ($alias) {
142 142
             return $alias;
143 143
         });
144 144
     }
Please login to merge, or discard this patch.
src/AliasBinder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /**
10 10
      * @var array
11 11
      */
12
-    protected static $routes = [];
12
+    protected static $routes = [ ];
13 13
 
14 14
     /**
15 15
      * @return array
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * @var array
24 24
      */
25
-    protected $aliases = [];
25
+    protected $aliases = [ ];
26 26
 
27 27
     /**
28 28
      * Register new alias.
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function add($alias, $class)
36 36
     {
37
-        $this->aliases[$alias] = $class;
37
+        $this->aliases[ $alias ] = $class;
38 38
 
39 39
         if (method_exists($class, 'registerRoutes')) {
40
-            self::$routes[] = [$class, 'registerRoutes'];
40
+            self::$routes[ ] = [ $class, 'registerRoutes' ];
41 41
         }
42 42
 
43 43
         return $this;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function getAlias($alias)
68 68
     {
69
-        return $this->aliases[$alias];
69
+        return $this->aliases[ $alias ];
70 70
     }
71 71
 
72 72
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function __call($name, $arguments)
93 93
     {
94
-        if (! $this->hasAlias($name)) {
94
+        if (!$this->hasAlias($name)) {
95 95
             throw new BadMethodCallException($name);
96 96
         }
97 97
 
Please login to merge, or discard this patch.
src/Repository/TreeRepository.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $instance = $this->find($id);
211 211
         $attributes = $instance->getAttributes();
212
-        $attributes[$this->getLeftColumn($instance)] = $left;
213
-        $attributes[$this->getRightColumn($instance)] = $right;
214
-        $attributes[$this->getParentColumn($instance)] = $parentId;
212
+        $attributes[ $this->getLeftColumn($instance) ] = $left;
213
+        $attributes[ $this->getRightColumn($instance) ] = $right;
214
+        $attributes[ $this->getParentColumn($instance) ] = $parentId;
215 215
         $instance->setRawAttributes($attributes);
216 216
         $instance->save();
217 217
     }
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
     protected function recursiveReorder($root, $parentId, $left)
319 319
     {
320 320
         $right = $left + 1;
321
-        $children = array_get($root, 'children', []);
321
+        $children = array_get($root, 'children', [ ]);
322 322
         foreach ($children as $child) {
323
-            $right = $this->recursiveReorder($child, $root['id'], $right);
323
+            $right = $this->recursiveReorder($child, $root[ 'id' ], $right);
324 324
         }
325
-        $this->move($root['id'], $parentId, $left, $right);
325
+        $this->move($root[ 'id' ], $parentId, $left, $right);
326 326
         $left = $right + 1;
327 327
 
328 328
         return $left;
@@ -337,15 +337,15 @@  discard block
 block discarded – undo
337 337
     protected function recursiveReorderSimple($data, $parentId)
338 338
     {
339 339
         foreach ($data as $order => $item) {
340
-            $id = $item['id'];
340
+            $id = $item[ 'id' ];
341 341
 
342 342
             $instance = $this->find($id);
343 343
             $instance->{$this->getParentField()} = $parentId;
344 344
             $instance->{$this->getOrderField()} = $order;
345 345
             $instance->save();
346 346
 
347
-            if (isset($item['children'])) {
348
-                $this->recursiveReorderSimple($item['children'], $id);
347
+            if (isset($item[ 'children' ])) {
348
+                $this->recursiveReorderSimple($item[ 'children' ], $id);
349 349
             }
350 350
         }
351 351
     }
@@ -361,14 +361,14 @@  discard block
 block discarded – undo
361 361
     protected function getChildren($collection, $id)
362 362
     {
363 363
         $parentField = $this->getParentField();
364
-        $result = [];
364
+        $result = [ ];
365 365
         foreach ($collection as $instance) {
366 366
             if ($instance->$parentField != $id) {
367 367
                 continue;
368 368
             }
369 369
 
370 370
             $instance->setRelation('children', $this->getChildren($collection, $instance->getKey()));
371
-            $result[] = $instance;
371
+            $result[ ] = $instance;
372 372
         }
373 373
 
374 374
         return Collection::make($result);
Please login to merge, or discard this patch.