Passed
Push — master ( 6113e5...b6ce23 )
by Reza
14:09
created
src/Commands/MakeCRUD.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $names = $this->argument('name') ? [$this->argument('name')] : config('easy_panel.actions', []);
18 18
 
19
-        if(is_null($names)) {
19
+        if (is_null($names)) {
20 20
             throw new CommandNotFoundException("There is no action in config file");
21 21
         }
22 22
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $model = explode('\\', $model);
41 41
         $model = strtolower(end($model));
42 42
 
43
-        if($model != $name){
43
+        if ($model != $name) {
44 44
             throw new CommandNotFoundException("Action key should be equal to model name, You are using {$name} as key name but your model name is {$model}");
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(! function_exists('getRouteName')) {
4
-    function getRouteName(){
3
+if (!function_exists('getRouteName')) {
4
+    function getRouteName() {
5 5
         $routeName = config('easy_panel.route_prefix');
6 6
         $routeName = trim($routeName, '/');
7 7
         $routeName = str_replace('/', '.', $routeName);
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
     }
10 10
 }
11 11
 
12
-if(! function_exists('get_icon')) {
13
-    function get_icon($type){
12
+if (!function_exists('get_icon')) {
13
+    function get_icon($type) {
14 14
         $array = [
15 15
             'file-text' => ['posts', 'article', 'stories', 'post', 'articles', 'story'],
16 16
             'users' => ['users', 'user', 'accounts', 'account', 'admins', 'admin', 'employee', 'employees'],
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
             'truck' => ['product', 'products', 'shops', 'shop'],
28 28
             'message-circle' => ['comments', 'messages', 'pm', 'comment', 'message', 'chats', 'chat'],
29 29
         ];
30
-        foreach ($array as $key => $arrayValues){
31
-            if(in_array($type, $arrayValues)){
30
+        foreach ($array as $key => $arrayValues) {
31
+            if (in_array($type, $arrayValues)) {
32 32
                 $val = $key;
33 33
             }
34 34
         }
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
     }
37 37
 }
38 38
 
39
-if(! function_exists('registerActionRoutes')){
39
+if (!function_exists('registerActionRoutes')) {
40 40
     function registerActionRoutes($action, $component, $crudConfig)
41 41
     {
42
-        Route::prefix($action)->name("$action.")->group(function () use ($component, $crudConfig, $action) {
42
+        Route::prefix($action)->name("$action.")->group(function() use ($component, $crudConfig, $action) {
43 43
 
44
-            if(@class_exists("$component\\Read")) {
44
+            if (@class_exists("$component\\Read")) {
45 45
                 Route::get('/', "$component\\Read")->name('read');
46 46
             }
47 47
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             }
51 51
 
52 52
             if (@$crudConfig['update'] and @class_exists("$component\\Update")) {
53
-                Route::get('/update/{' . $action . '}', "$component\\Update")->name('update');
53
+                Route::get('/update/{'.$action.'}', "$component\\Update")->name('update');
54 54
             }
55 55
 
56 56
         });
Please login to merge, or discard this patch.
src/Commands/Actions/CommandBase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@
 block discarded – undo
40 40
 
41 41
     protected function getStub()
42 42
     {
43
-        return __DIR__ . DIRECTORY_SEPARATOR. "..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."{$this->file}.stub";
43
+        return __DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."{$this->file}.stub";
44 44
     }
45 45
 
46 46
     private function buildBlade()
47 47
     {
48
-        $stub = $this->files->get(__DIR__ . DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."blade".DIRECTORY_SEPARATOR."{$this->file}.blade.stub");
48
+        $stub = $this->files->get(__DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."blade".DIRECTORY_SEPARATOR."{$this->file}.blade.stub");
49 49
         $newStub = $this->stubParser->parseBlade($stub);
50 50
 
51 51
         $path = $this->viewPath("livewire".DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."{$this->getNameInput()}".DIRECTORY_SEPARATOR."{$this->file}.blade.php");
52 52
 
53
-        if (! $this->files->isDirectory(dirname($path))) {
53
+        if (!$this->files->isDirectory(dirname($path))) {
54 54
             $this->files->makeDirectory(dirname($path), 0755, true);
55 55
         }
56 56
 
Please login to merge, or discard this patch.
src/Commands/MakeCRUDConfig.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function handle()
25 25
     {
26
-        if(!$this->option('model')){
26
+        if (!$this->option('model')) {
27 27
             $this->error("Model option must have a value");
28 28
             return;
29 29
         }
30 30
 
31 31
         $name = strtolower($this->getNameInput());
32 32
 
33
-        if($name != strtolower($this->option('model'))){
33
+        if ($name != strtolower($this->option('model'))) {
34 34
             $this->warn("'{$name}' must be equal to model name");
35 35
             return;
36 36
         }
37 37
 
38 38
         $path = resource_path("cruds/{$name}.php");
39 39
 
40
-        if($this->files->exists($path) and !$this->option('force')){
40
+        if ($this->files->exists($path) and !$this->option('force')) {
41 41
             $this->warn("'{$name}' already exists in CRUDs config");
42 42
             return;
43 43
         }
44 44
 
45
-        if (! $this->files->isDirectory(dirname($path))) {
45
+        if (!$this->files->isDirectory(dirname($path))) {
46 46
             $this->files->makeDirectory(dirname($path), 0755, true);
47 47
         }
48 48
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         $model = $this->qualifyModel($this->option('model'));
78 78
 
79
-        if(!class_exists($model)){
79
+        if (!class_exists($model)) {
80 80
             $this->warn("Model option should be valid and model should be exist");
81 81
             die();
82 82
         }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     private function withAuth()
88 88
     {
89 89
         $fillableList = $this->getFillableList();
90
-        if(!in_array('user_id', $fillableList)){
90
+        if (!in_array('user_id', $fillableList)) {
91 91
             return 'true';
92 92
         }
93 93
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $fillableList = $this->getFillableList();
107 107
         $array = [];
108
-        foreach ($fillableList as $fillable){
109
-            if(!Str::contains($fillable, 'id')){
108
+        foreach ($fillableList as $fillable) {
109
+            if (!Str::contains($fillable, 'id')) {
110 110
                 $array[] = "'$fillable'";
111 111
             }
112 112
         }
Please login to merge, or discard this patch.
src/EasyPanelServiceProvider.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
     public function register()
36 36
     {
37 37
         // Here we merge config with 'easy_panel' key
38
-        $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel');
38
+        $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel');
39 39
 
40 40
         // Check the status of module
41
-        if(!config('easy_panel.enable')) {
41
+        if (!config('easy_panel.enable')) {
42 42
             return;
43 43
         }
44 44
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function boot()
56 56
     {
57
-        if(!config('easy_panel.enable')) {
57
+        if (!config('easy_panel.enable')) {
58 58
             return;
59 59
         }
60 60
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         }
64 64
 
65 65
         // Load Views
66
-        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin');
66
+        $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin');
67 67
 
68 68
         // Register Middleware
69 69
         $this->registerMiddlewareAlias();
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
 
78 78
     private function defineRoutes()
79 79
     {
80
-        if(!$this->app->routesAreCached()) {
80
+        if (!$this->app->routesAreCached()) {
81 81
             Route::prefix(config('easy_panel.route_prefix'))
82 82
                 ->middleware(['web', 'auth', 'isAdmin', 'LangChanger'])
83
-                ->name(getRouteName() . '.')
84
-                ->group(__DIR__ . '/routes.php');
83
+                ->name(getRouteName().'.')
84
+                ->group(__DIR__.'/routes.php');
85 85
         }
86 86
     }
87 87
 
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 
108 108
     private function mergePublishes()
109 109
     {
110
-        $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config');
110
+        $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config');
111 111
 
112
-        $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views');
112
+        $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views');
113 113
 
114
-        $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles');
114
+        $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles');
115 115
 
116
-        $this->publishes([__DIR__ . '/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_99999_create_admin_todos_table.php')], 'easy-panel-migrations');
116
+        $this->publishes([__DIR__.'/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_99999_create_admin_todos_table.php')], 'easy-panel-migrations');
117 117
 
118 118
         $this->publishes([__DIR__.'/../resources/lang' => resource_path('/lang')], 'easy-panel-lang');
119 119
     }
Please login to merge, or discard this patch.
src/Parsers/HTMLInputs/BaseInput.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
         $this->action = $action;
28 28
     }
29 29
 
30
-    public function render(){
30
+    public function render() {
31 31
         $name = $this->name;
32 32
 
33 33
         // Create an instance of input class
34 34
         // then call handle() method to get input as a steing
35
-        if(!is_array($this->type)) {
35
+        if (!is_array($this->type)) {
36 36
             $inputStringClass = static::classMap[$this->type];
37 37
             $input = (new $inputStringClass())->handle($name);
38 38
         } else {
Please login to merge, or discard this patch.
src/Parsers/HTMLInputs/Select.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@
 block discarded – undo
8 8
     public function handle($name, $values, $action)
9 9
     {
10 10
 
11
-        if(!class_exists($values[0])) {
11
+        if (!class_exists($values[0])) {
12 12
             return "<select wire:model='$name' class=\"form-control @error('$name') is-invalid @enderror\" id='input$name'>
13
-                    @foreach(config('easy_panel.crud.$action.fields.$name')['select'] as " . '$key => $value' . ")
14
-                        <option value='{{ " . '$key' . " }}'>{{ " . '$value' . " }}</option>
13
+                    @foreach(config('easy_panel.crud.$action.fields.$name')['select'] as ".'$key => $value'.")
14
+                        <option value='{{ " . '$key'." }}'>{{ ".'$value'." }}</option>
15 15
                     @endforeach
16 16
                 </select>";
17 17
         }
18 18
 
19 19
         return "<select wire:model='$name' class=\"form-control @error('$name') is-invalid @enderror\" id='input$name'>
20
-                    @foreach((new $values[0])->pluck('$values[2]', '$values[1]') as " . '$key => $value' . ")
21
-                        <option value='{{ " . '$key' . " }}'>{{ " . '$value' . " }}</option>
20
+                    @foreach((new $values[0])->pluck('$values[2]', '$values[1]') as ".'$key => $value'.")
21
+                        <option value='{{ " . '$key'." }}'>{{ ".'$value'." }}</option>
22 22
                     @endforeach
23 23
                 </select>";
24 24
 
Please login to merge, or discard this patch.