Completed
Push — master ( e9b6b0...ff760b )
by CodexShaper
06:02
created
src/Database/Platforms/Platform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public static function getPlatform($platformName)
19 19
     {
20
-        $platform = __NAMESPACE__ . '\\' . ucfirst($platformName);
20
+        $platform = __NAMESPACE__.'\\'.ucfirst($platformName);
21 21
 
22 22
         if (!class_exists($platform)) {
23 23
             throw new \Exception("Platform {$platformName} doesn't exist");
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/Database/Drivers/MongoDB/Type.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
     public static function dateTime($milliseconds = null)
118 118
     {
119 119
         if (!is_int($milliseconds) || !is_float($milliseconds) || !is_string($milliseconds) || !$milliseconds instanceof \DateTimeInterface) {
120
-            throw new \Exception($milliseconds . " integer or float or string or instance of DateTimeInterface");
120
+            throw new \Exception($milliseconds." integer or float or string or instance of DateTimeInterface");
121 121
 
122 122
         }
123 123
         return new UTCDateTime($milliseconds);
Please login to merge, or discard this patch.
src/Database/Schema/ForeignKey.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@
 block discarded – undo
68 68
      */
69 69
     public static function createName($columns, $type, $table = null)
70 70
     {
71
-        $table = isset($table) ? trim($table) . '_' : '';
71
+        $table = isset($table) ? trim($table).'_' : '';
72 72
         $type  = trim($type);
73
-        $name  = strtolower($table . implode('_', $columns) . '_' . $type);
73
+        $name  = strtolower($table.implode('_', $columns).'_'.$type);
74 74
 
75 75
         return str_replace(['-', '.'], '_', $name);
76 76
     }
Please login to merge, or discard this patch.
database/seeds/DatabaseManagerSeeder.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
 
5 5
 class DatabaseManagerSeeder extends Seeder
6 6
 {
7
-    protected $seedersPath = __DIR__ . '/../../database/seeds/';
7
+    protected $seedersPath = __DIR__.'/../../database/seeds/';
8 8
 
9 9
     /**
10 10
      * Seed the application's database.
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
         foreach ($seeds as $class) {
21 21
 
22
-            $file = $this->seedersPath . $class . '.php';
22
+            $file = $this->seedersPath.$class.'.php';
23 23
             if (file_exists($file) && !class_exists($class)) {
24 24
                 require_once $file;
25 25
             }
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.
routes/api.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
     'prefix'     => 'database',
5 5
     'middleware' => 'auth:api',
6 6
     'namespace'  => config('dbm.controller_namespace'),
7
-], function () {
7
+], function() {
8 8
 
9 9
     // Helpers Route
10 10
     Route::get('assets', 'ManagerController@assets')->name('dbm.asset');
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     Route::put('/relationship', 'RelationController@update');
45 45
     Route::delete('/relationship', 'RelationController@delete');
46 46
     // Table
47
-    Route::group(['prefix' => 'table'], function () {
47
+    Route::group(['prefix' => 'table'], function() {
48 48
         Route::get('/details/{table}', 'RecordController@getTableDetails');
49 49
         Route::get('/columns/{table}', 'TableController@getTableColumns');
50 50
     });
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 Route::group([
58 58
     'prefix'    => 'database',
59 59
     'namespace' => config('dbm.controller_namespace'),
60
-], function () {
60
+], function() {
61 61
     // User
62 62
     Route::post('/login', 'UserController@login');
63 63
 });
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
 
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             case 'not_authorized':
364 364
                 return response()->json([
365 365
                     'success' => false,
366
-                    'errors'  => ["You don't have permission to " . $slug . " " . $prefix],
366
+                    'errors'  => ["You don't have permission to ".$slug." ".$prefix],
367 367
                 ], 401);
368 368
                 break;
369 369
             case 'authorized':
Please login to merge, or discard this patch.