Completed
Push — master ( 24dcac...1d88b8 )
by CodexShaper
04:29
created
src/Http/Controllers/CrudController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
                         $modelName = ucfirst(Str::singular($object->name));
95 95
 
96
-                        $model         = $namespace . '\\' . $modelName;
96
+                        $model         = $namespace.'\\'.$modelName;
97 97
                         $object->model = $model;
98 98
                     }
99 99
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                     $table = Table::getTable($tableName);
106 106
 
107 107
                     $modelName = ucfirst(Str::singular($table['name']));
108
-                    $model     = $namespace . '\\' . $modelName;
108
+                    $model     = $namespace.'\\'.$modelName;
109 109
 
110 110
                     $object               = new \stdClass;
111 111
                     $object->name         = $table['name'];
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             } else if ($table['makeModel'] == false && !class_exists($table['model'])) {
185 185
                 return response()->json([
186 186
                     'success' => false,
187
-                    'errors'  => ["Create model '" . $table['model'] . "' first or checked create model option"],
187
+                    'errors'  => ["Create model '".$table['model']."' first or checked create model option"],
188 188
                 ], 400);
189 189
             }
190 190
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             if ($table['makeModel'] == true) {
251 251
                 \DBM::makeModel($table['model'], $table['name']);
252 252
             } else if ($table['makeModel'] == false && !class_exists($table['model'])) {
253
-                return $this->generateError(["Create mode '" . $table['model'] . "' first."]);
253
+                return $this->generateError(["Create mode '".$table['model']."' first."]);
254 254
             }
255 255
 
256 256
             if (!class_exists($table['controller'])) {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
             $prefix = (Driver::isMongoDB()) ? "_" : "";
390 390
 
391 391
             foreach ($fields as $fld) {
392
-                if ($fld->id == $field->{$prefix . "id"}) {
392
+                if ($fld->id == $field->{$prefix."id"}) {
393 393
 
394 394
                     $relationship = $fld->settings;
395 395
                     $localTable   = $relationship['localTable'];
@@ -423,17 +423,17 @@  discard block
 block discarded – undo
423 423
 
424 424
             if (!class_exists($relationship['localModel'])) {
425 425
 
426
-                $error = $relationship['localModel'] . " Model not found. Please create the " . $relationship['localModel'] . " model first";
426
+                $error = $relationship['localModel']." Model not found. Please create the ".$relationship['localModel']." model first";
427 427
                 return $this->generateError([$error]);
428 428
             }
429 429
 
430 430
             if (!class_exists($relationship['foreignModel'])) {
431 431
 
432
-                $error = $relationship['foreignModel'] . " Model not found. Please create the " . $relationship['foreignModel'] . " model first";
432
+                $error = $relationship['foreignModel']." Model not found. Please create the ".$relationship['foreignModel']." model first";
433 433
                 return $this->generateError([$error]);
434 434
             }
435 435
 
436
-            $fieldName = strtolower(Str::singular($relationship['localTable']) . '_' . $relationship['type'] . '_' . Str::singular($relationship['foreignTable']) . '_relationship');
436
+            $fieldName = strtolower(Str::singular($relationship['localTable']).'_'.$relationship['type'].'_'.Str::singular($relationship['foreignTable']).'_relationship');
437 437
             $settings  = [
438 438
                 'relationType'    => $relationship['type'],
439 439
                 'localModel'      => $relationship['localModel'],
Please login to merge, or discard this patch.
src/Commands/DatabaseBackup.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function findComposer()
46 46
     {
47
-        if (file_exists(getcwd() . '/composer.phar')) {
48
-            return '"' . PHP_BINARY . '" ' . getcwd() . '/composer.phar';
47
+        if (file_exists(getcwd().'/composer.phar')) {
48
+            return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
49 49
         }
50 50
         return 'composer';
51 51
     }
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
     {
55 55
 
56 56
         $prefix = (strlen($table) > 0)
57
-        ? 'table_' . strtolower(str_replace('-', '_', $table)) . "_"
58
-        : 'database_' . strtolower(str_replace('-', '_', $database)) . "_";
57
+        ? 'table_'.strtolower(str_replace('-', '_', $table))."_"
58
+        : 'database_'.strtolower(str_replace('-', '_', $database))."_";
59 59
 
60 60
         $extension = Driver::isMongoDB() ? '' : '.sql';
61
-        $fileName  = $prefix . 'backup_' . date('G_a_m_d_y_h_i_s') . $extension;
61
+        $fileName  = $prefix.'backup_'.date('G_a_m_d_y_h_i_s').$extension;
62 62
 
63 63
         if (Driver::isSqlite()) {
64
-            $fileName = 'backup_' . date('G_a_m_d_y_h_i_s') . $extension;
64
+            $fileName = 'backup_'.date('G_a_m_d_y_h_i_s').$extension;
65 65
         }
66 66
 
67 67
         return $fileName;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $compressBinaryPath = config('dbm.backup.compress_binary_path', "");
75 75
         $compressCommand    = config('dbm.backup.compress_command', "gzip");
76 76
         $compressExtension  = config('dbm.backup.compress_extension', ".gz");
77
-        $dumpBinaryPath     = config('dbm.backup.' . $data['driver'] . '.binary_path', '');
77
+        $dumpBinaryPath     = config('dbm.backup.'.$data['driver'].'.binary_path', '');
78 78
 
79 79
         switch ($data['driver']) {
80 80
             case 'mysql':
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         // $hostname = config('database.connections.' . $driver . '.host', '127.0.0.1');
122 122
         // $port     = config('database.connections.' . $driver . '.port', '3306');
123
-        $database = config('database.connections.' . $driver . '.database', 'dbm');
123
+        $database = config('database.connections.'.$driver.'.database', 'dbm');
124 124
         $table    = ($this->option('table') != null) ? $this->option('table') : '';
125 125
         // $username = config('database.connections.' . $driver . '.username', 'root');
126 126
         // $password = config('database.connections.' . $driver . '.password', '');
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
             $directory = (config('dbm.backup.dir', 'backups') != '')
131 131
             ? DIRECTORY_SEPARATOR . config('dbm.backup.dir', 'backups')
132 132
             : '';
133
-            $directoryPath = DBM::getPathPrefix() . $directory . DIRECTORY_SEPARATOR . $driver;
134
-            $filePath      = $directoryPath . DIRECTORY_SEPARATOR . $this->getFileName($table, $database);
133
+            $directoryPath = DBM::getPathPrefix().$directory.DIRECTORY_SEPARATOR.$driver;
134
+            $filePath      = $directoryPath.DIRECTORY_SEPARATOR.$this->getFileName($table, $database);
135 135
 
136 136
             if (!File::isDirectory($directoryPath)) {
137 137
 
Please login to merge, or discard this patch.