Completed
Push — master ( cef9ce...46ea26 )
by CodexShaper
05:31
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/Manager.php 1 patch
Spacing   +12 added lines, -12 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
@@ -119,27 +119,27 @@  discard block
 block discarded – undo
119 119
             $namespace = implode("\\", $partials);
120 120
 
121 121
             $contents = "<?php\n\n";
122
-            $contents .= "namespace " . $namespace . ";\n\n";
122
+            $contents .= "namespace ".$namespace.";\n\n";
123 123
             if (Driver::isMongoDB()) {
124 124
                 $contents .= "use Jenssegers\Mongodb\Eloquent\Model;\n\n";
125 125
             } else {
126 126
                 $contents .= "use Illuminate\Database\Eloquent\Model;\n\n";
127 127
             }
128
-            $contents .= "class " . $className . " extends Model\n";
128
+            $contents .= "class ".$className." extends Model\n";
129 129
             $contents .= "{\n\n";
130 130
             if (Driver::isMongoDB()) {
131
-                $contents .= "\tprotected \$collection = '" . $table . "';\n";
131
+                $contents .= "\tprotected \$collection = '".$table."';\n";
132 132
             } else {
133
-                $contents .= "\tprotected \$table = '" . $table . "';\n";
133
+                $contents .= "\tprotected \$table = '".$table."';\n";
134 134
             }
135 135
 
136 136
             // $content .= "\tpublic \$timestamps = false;\n";
137 137
             $contents .= "}\n";
138 138
 
139 139
             $filesystem = new Filesystem;
140
-            $filesystem->put(base_path($model . ".php"), $contents);
140
+            $filesystem->put(base_path($model.".php"), $contents);
141 141
         } catch (\Exception $e) {
142
-            throw new \Exception("There has an error when create model. The error is :" . $e->getMessage(), 1);
142
+            throw new \Exception("There has an error when create model. The error is :".$e->getMessage(), 1);
143 143
 
144 144
         }
145 145
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 'name' => $controller,
159 159
             ]);
160 160
         } catch (\Exception $e) {
161
-            throw new \Exception("There has an error when create Controller. The error is :" . $e->getMessage(), 1);
161
+            throw new \Exception("There has an error when create Controller. The error is :".$e->getMessage(), 1);
162 162
 
163 163
         }
164 164
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
             case 'not_authorized':
356 356
                 return response()->json([
357 357
                     'success' => false,
358
-                    'errors'  => ["You don't have permission to " . $slug . " " . $prefix],
358
+                    'errors'  => ["You don't have permission to ".$slug." ".$prefix],
359 359
                 ], 401);
360 360
                 break;
361 361
             case 'authorized':
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.
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') {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         } else if ($action == 'update' && isset($settings->update)) {
251 251
             $updateSettings = $settings->update;
252 252
             $localKey       = $updateSettings->localKey;
253
-            $rules          = $updateSettings->rules . ',' . $columns->{$localKey};
253
+            $rules          = $updateSettings->rules.','.$columns->{$localKey};
254 254
         }
255 255
 
256 256
         return $rules;
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/Commands/InstallDatabaseManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var string
28 28
      */
29
-    protected $seedersPath = __DIR__ . '/../../database/seeds/';
29
+    protected $seedersPath = __DIR__.'/../../database/seeds/';
30 30
 
31 31
     /**
32 32
      * Get Option
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
      */
48 48
     protected function findComposer()
49 49
     {
50
-        if (file_exists(getcwd() . '/composer.phar')) {
51
-            return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar';
50
+        if (file_exists(getcwd().'/composer.phar')) {
51
+            return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
52 52
         }
53 53
         return 'composer';
54 54
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // Dump autoload
79 79
         $this->info('Dumping the autoloaded files and reloading all new files');
80 80
         $composer = $this->findComposer();
81
-        $process  = new Process($composer . ' dump-autoload');
81
+        $process  = new Process($composer.' dump-autoload');
82 82
         $process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time
83 83
         $process->setWorkingDirectory(base_path())->run();
84 84
         // Load Custom Database Manager routes
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         // Database seeder
101 101
         $this->info('Seeding...');
102 102
         $class = 'DatabaseManagerSeeder';
103
-        $file  = $this->seedersPath . $class . '.php';
103
+        $file  = $this->seedersPath.$class.'.php';
104 104
         if (file_exists($file) && !class_exists($class)) {
105 105
             require_once $file;
106 106
         }
Please login to merge, or discard this patch.