Completed
Push — master ( 6f54d6...ffe8b5 )
by CodexShaper
05:45
created
src/Http/Controllers/BackupController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,12 +62,12 @@
 block discarded – undo
62 62
     public function getPaginateFiles(Request $request)
63 63
     {
64 64
         $driver = dbm_driver();
65
-        $directory = 'backups' . DIRECTORY_SEPARATOR . $driver;
65
+        $directory = 'backups'.DIRECTORY_SEPARATOR.$driver;
66 66
         $files = collect(Storage::allFiles($directory));
67 67
 
68 68
         $query = $request->q;
69 69
         if (!empty($query)) {
70
-            $files = $files->filter(function ($file) use ($query) {
70
+            $files = $files->filter(function($file) use ($query) {
71 71
                 $info = pathinfo($file);
72 72
                 return false !== stristr($info['basename'], $query);
73 73
             });
Please login to merge, or discard this patch.
src/ManagerServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function boot()
31 31
     {
32
-        $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
33
-        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'dbm');
32
+        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
33
+        $this->loadViewsFrom(__DIR__.'/../resources/views', 'dbm');
34 34
     }
35 35
 
36 36
     /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $database = $this->app->config['database'];
44 44
         // Bind Dumper to backup and and restore
45
-        $this->app->bind(Dumper::class, function ($app) use ($database) {
45
+        $this->app->bind(Dumper::class, function($app) use ($database) {
46 46
             $connection = $database['default'];
47 47
             $options = [
48 48
                 "host" => $database["connections"][$connection]["host"] ?? '',
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
 
89 89
         $this->mergeConfigFrom(
90
-            __DIR__ . '/../config/dbm.php', 'config'
90
+            __DIR__.'/../config/dbm.php', 'config'
91 91
         );
92 92
         $this->loadHelpers();
93 93
         $this->registerPublish();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected function loadHelpers()
103 103
     {
104
-        foreach (glob(__DIR__ . '/Helpers/*.php') as $filename) {
104
+        foreach (glob(__DIR__.'/Helpers/*.php') as $filename) {
105 105
             require_once $filename;
106 106
         }
107 107
     }
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $publishable = [
117 117
             'dbm.config' => [
118
-                __DIR__ . '/../config/dbm.php' => config_path('dbm.php'),
118
+                __DIR__.'/../config/dbm.php' => config_path('dbm.php'),
119 119
             ],
120 120
             'dbm.seeds' => [
121
-                __DIR__ . "/../database/seeds/" => database_path('seeds'),
121
+                __DIR__."/../database/seeds/" => database_path('seeds'),
122 122
             ],
123 123
             'dbm.views' => [
124
-                __DIR__ . '/../resources/views' => resource_path('views/vendor/dbm/views'),
124
+                __DIR__.'/../resources/views' => resource_path('views/vendor/dbm/views'),
125 125
             ],
126 126
             'dbm.resources' => [
127
-                __DIR__ . '/../resources' => resource_path('views/vendor/dbm'),
127
+                __DIR__.'/../resources' => resource_path('views/vendor/dbm'),
128 128
             ],
129 129
         ];
130 130
 
Please login to merge, or discard this patch.
src/Manager.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function webRoutes()
31 31
     {
32
-        require __DIR__ . '/../routes/web.php';
32
+        require __DIR__.'/../routes/web.php';
33 33
     }
34 34
     /**
35 35
      * Include API routes.
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function apiRoutes()
40 40
     {
41
-        require __DIR__ . '/../routes/api.php';
41
+        require __DIR__.'/../routes/api.php';
42 42
     }
43 43
 
44 44
     /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function assets($path)
52 52
     {
53
-        $file = base_path(trim(config('dbm.resources_path'), '/') . "/" . urldecode($path));
53
+        $file = base_path(trim(config('dbm.resources_path'), '/')."/".urldecode($path));
54 54
 
55 55
         if (File::exists($file)) {
56 56
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function generateModelName($className)
101 101
     {
102
-        return static::getModelNamespace() . '\\' . ucfirst(Str::singular($className));
102
+        return static::getModelNamespace().'\\'.ucfirst(Str::singular($className));
103 103
     }
104 104
     /**
105 105
      * Make new model.
@@ -120,39 +120,39 @@  discard block
 block discarded – undo
120 120
             $app = array_shift($partials);
121 121
             $directory = implode(DIRECTORY_SEPARATOR, $partials);
122 122
             if (strtolower($app) != 'app') {
123
-                $namespace = "App\\" . $namespace;
124
-                $directory = $app . DIRECTORY_SEPARATOR . $directory;
123
+                $namespace = "App\\".$namespace;
124
+                $directory = $app.DIRECTORY_SEPARATOR.$directory;
125 125
             }
126 126
 
127
-            $path = app_path() . DIRECTORY_SEPARATOR . $directory;
127
+            $path = app_path().DIRECTORY_SEPARATOR.$directory;
128 128
 
129 129
             if (!File::isDirectory($path)) {
130 130
                 File::makeDirectory($path, 0777, true, true);
131 131
             }
132 132
 
133 133
             $contents = "<?php\n\n";
134
-            $contents .= "namespace " . $namespace . ";\n\n";
134
+            $contents .= "namespace ".$namespace.";\n\n";
135 135
             if (Driver::isMongoDB()) {
136 136
                 $contents .= "use Jenssegers\Mongodb\Eloquent\Model;\n\n";
137 137
             } else {
138 138
                 $contents .= "use Illuminate\Database\Eloquent\Model;\n\n";
139 139
             }
140
-            $contents .= "class " . $className . " extends Model\n";
140
+            $contents .= "class ".$className." extends Model\n";
141 141
             $contents .= "{\n\n";
142 142
             if (Driver::isMongoDB()) {
143
-                $contents .= "\tprotected \$collection = '" . $table . "';\n";
143
+                $contents .= "\tprotected \$collection = '".$table."';\n";
144 144
             } else {
145
-                $contents .= "\tprotected \$table = '" . $table . "';\n";
145
+                $contents .= "\tprotected \$table = '".$table."';\n";
146 146
             }
147 147
 
148 148
             // $content .= "\tpublic \$timestamps = false;\n";
149 149
             $contents .= "}\n";
150 150
 
151 151
             $filesystem = new Filesystem;
152
-            $filesystem->put($path . DIRECTORY_SEPARATOR . $className . ".php", $contents);
152
+            $filesystem->put($path.DIRECTORY_SEPARATOR.$className.".php", $contents);
153 153
 
154 154
         } catch (\Exception $e) {
155
-            throw new \Exception("There has an error when create model. The error is :" . $e->getMessage(), 1);
155
+            throw new \Exception("There has an error when create model. The error is :".$e->getMessage(), 1);
156 156
 
157 157
         }
158 158
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 'name' => $controller,
172 172
             ]);
173 173
         } catch (\Exception $e) {
174
-            throw new \Exception("There has an error when create Controller. The error is :" . $e->getMessage(), 1);
174
+            throw new \Exception("There has an error when create Controller. The error is :".$e->getMessage(), 1);
175 175
 
176 176
         }
177 177
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             case 'not_authorized':
371 371
                 return response()->json([
372 372
                     'success' => false,
373
-                    'errors' => ["You don't have permission to " . $slug . " " . $prefix],
373
+                    'errors' => ["You don't have permission to ".$slug." ".$prefix],
374 374
                 ], 401);
375 375
                 break;
376 376
             case 'authorized':
Please login to merge, or discard this patch.
src/Commands/DatabaseBackup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
         switch ($data['driver']) {
79 79
             case 'mysql':
80 80
             case 'pgsql':
81
-                if (! empty($data['table'])) {
81
+                if (!empty($data['table'])) {
82 82
                     $dumper->setTables($data['table']);
83 83
                 }
84 84
                 break;
85 85
             case 'mongodb':
86 86
                 $dsn = config('dbm.backup.mongodb.dsn', '');
87
-                if (! empty($dsn) && method_exists($dumper, 'setUri')) {
87
+                if (!empty($dsn) && method_exists($dumper, 'setUri')) {
88 88
                     $dumper->setUri($dsn);
89 89
                 }
90 90
                 break;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             $directoryPath = storage_path('app').$directory.DIRECTORY_SEPARATOR.$driver;
127 127
             $filePath = $directoryPath.DIRECTORY_SEPARATOR.$this->getFileName($table, $database);
128 128
   
129
-            if (! File::isDirectory($directoryPath)) {
129
+            if (!File::isDirectory($directoryPath)) {
130 130
                 File::makeDirectory($directoryPath, 0777, true, true);
131 131
             }
132 132
 
Please login to merge, or discard this patch.
src/Commands/InstallDatabaseManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
         // Seeding Dummy Data
104 104
         $class = 'DatabaseManagerSeeder';
105 105
         $file = $this->seedersPath.$class.'.php';
106
-        if (file_exists($file) && ! class_exists($class)) {
106
+        if (file_exists($file) && !class_exists($class)) {
107 107
             require_once $file;
108 108
         }
109 109
         with(new $class())->run();
Please login to merge, or discard this patch.
src/Commands/DatabaseRestore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
             switch ($driver) {
91 91
                 case 'mongodb':
92 92
                     $dsn = config('dbm.backup.mongodb.dsn', '');
93
-                    if (! empty($dsn)) {
93
+                    if (!empty($dsn)) {
94 94
                         $dumper->setUri($dsn);
95 95
                     }
96 96
                     break;
Please login to merge, or discard this patch.
src/Helpers/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 if (!function_exists('dbm_asset')) {
4 4
     function dbm_asset($path, $secure = null)
5 5
     {
6
-        return route('dbm.asset') . '?path=' . urlencode($path);
6
+        return route('dbm.asset').'?path='.urlencode($path);
7 7
     }
8 8
 }
9 9
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $jsonArr = [];
35 35
         $i = 1;
36 36
         foreach ($arr as $key => $value) {
37
-            $jsonArr['key_' . $i++] = $value;
37
+            $jsonArr['key_'.$i++] = $value;
38 38
         }
39 39
         return json_encode($jsonArr);
40 40
     }
Please login to merge, or discard this patch.
src/Traits/RecordTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         $files = $request->file($column);
44 44
         $values = [];
45 45
         foreach ($files as $file) {
46
-            $fileName = Str::random(config('dbm.filesystem.random_length')) . '.' . $file->getClientOriginalExtension();
47
-            $path = trim(config('dbm.filesystem.dir'), '/') . DIRECTORY_SEPARATOR . $tableName;
46
+            $fileName = Str::random(config('dbm.filesystem.random_length')).'.'.$file->getClientOriginalExtension();
47
+            $path = trim(config('dbm.filesystem.dir'), '/').DIRECTORY_SEPARATOR.$tableName;
48 48
             $file->storeAs($path, $fileName);
49 49
             $values[] = $fileName;
50 50
         }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $fieldType = $this->getFieldType($tableName, $column);
79 79
 
80 80
             if (!in_array($fieldType, Type::getTypes())) {
81
-                $this->generateError([$fieldType . " type not supported."]);
81
+                $this->generateError([$fieldType." type not supported."]);
82 82
             }
83 83
 
84 84
             if ($fieldType != 'timestamp') {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             $rules = $updateSettings->rules;
253 253
             if (isset($updateSettings->localKey)) {
254 254
                 $localKey = $updateSettings->localKey;
255
-                $rules = $updateSettings->rules . ',' . $columns->{$localKey};
255
+                $rules = $updateSettings->rules.','.$columns->{$localKey};
256 256
             }
257 257
         }
258 258
 
Please login to merge, or discard this patch.
src/Traits/MongoConnection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
             $dsn = config('database.connections.mongodb.dsn');
28 28
 
29 29
             if (!$dsn) {
30
-                $dsn = 'mongodb://' . $host . ':' . $port . ($auth_db ? "/" . $auth_db : '');
30
+                $dsn = 'mongodb://'.$host.':'.$port.($auth_db ? "/".$auth_db : '');
31 31
             }
32 32
 
33 33
             self::$connection = new Client($dsn);
Please login to merge, or discard this patch.