@@ -78,13 +78,13 @@ discard block |
||
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 |
||
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 |
@@ -90,7 +90,7 @@ |
||
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; |
@@ -1,34 +1,34 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('dbm_asset')) { |
|
3 | +if (!function_exists('dbm_asset')) { |
|
4 | 4 | function dbm_asset($path, $secure = null) |
5 | 5 | { |
6 | 6 | return route('dbm.asset').'?path='.urlencode($path); |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | -if (! function_exists('dbm_driver')) { |
|
10 | +if (!function_exists('dbm_driver')) { |
|
11 | 11 | function dbm_driver() |
12 | 12 | { |
13 | 13 | return (config('database.default') != '') ? config('database.default') : 'mysql'; |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | -if (! function_exists('dbm_prefix')) { |
|
17 | +if (!function_exists('dbm_prefix')) { |
|
18 | 18 | function dbm_prefix() |
19 | 19 | { |
20 | 20 | return (config('dbm.prefix') != '') ? config('dbm.prefix') : ''; |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (! function_exists('is_json')) { |
|
24 | +if (!function_exists('is_json')) { |
|
25 | 25 | function is_json($string) |
26 | 26 | { |
27 | 27 | return is_string($string) && is_array(json_decode($string, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false; |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -if (! function_exists('save_json')) { |
|
31 | +if (!function_exists('save_json')) { |
|
32 | 32 | function save_json(array $arr) |
33 | 33 | { |
34 | 34 | $jsonArr = []; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if (! function_exists('retreive_json')) { |
|
44 | +if (!function_exists('retreive_json')) { |
|
45 | 45 | function retreive_json(string $str) |
46 | 46 | { |
47 | 47 | $jsonData = json_decode($str, true); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $database = $this->app->config['database']; |
43 | 43 | // Bind Dumper to backup and and restore |
44 | - $this->app->bind(Dumper::class, function ($app) use ($database) { |
|
44 | + $this->app->bind(Dumper::class, function($app) use ($database) { |
|
45 | 45 | $connection = $database['default']; |
46 | 46 | $options = [ |
47 | 47 | 'host' => $database['connections'][$connection]['host'] ?? '', |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function __construct() |
21 | 21 | { |
22 | - if (! self::$connection = DB::connection()->getMongoClient()) { |
|
22 | + if (!self::$connection = DB::connection()->getMongoClient()) { |
|
23 | 23 | $host = config('database.connections.mongodb.host'); |
24 | 24 | $port = config('database.connections.mongodb.port'); |
25 | 25 | $options = config('database.connections.mongodb.options'); |
26 | 26 | $auth_db = config('database.connections.mongodb.options.database') ? config('database.connections.mongodb.options.database') : null; |
27 | 27 | $dsn = config('database.connections.mongodb.dsn'); |
28 | 28 | |
29 | - if (! $dsn) { |
|
29 | + if (!$dsn) { |
|
30 | 30 | $dsn = 'mongodb://'.$host.':'.$port.($auth_db ? '/'.$auth_db : ''); |
31 | 31 | } |
32 | 32 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getMongoClient() |
45 | 45 | { |
46 | - if (! self::$connection) { |
|
46 | + if (!self::$connection) { |
|
47 | 47 | new self(); |
48 | 48 | } |
49 | 49 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | if (count($values) > 1) { |
52 | 52 | $value = $values; |
53 | - if (! Driver::isMongoDB()) { |
|
53 | + if (!Driver::isMongoDB()) { |
|
54 | 54 | $value = json_encode($values); |
55 | 55 | } |
56 | 56 | } elseif (count($values) == 1) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (Driver::isMongoDB()) { |
77 | 77 | $fieldType = $this->getFieldType($tableName, $column); |
78 | 78 | |
79 | - if (! in_array($fieldType, Type::getTypes())) { |
|
79 | + if (!in_array($fieldType, Type::getTypes())) { |
|
80 | 80 | $this->generateError([$fieldType.' type not supported.']); |
81 | 81 | } |
82 | 82 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | break; |
68 | 68 | } |
69 | 69 | |
70 | - if (! $mimeType) { |
|
70 | + if (!$mimeType) { |
|
71 | 71 | $mimeType = 'text/plain'; |
72 | 72 | } |
73 | 73 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $path = app_path().DIRECTORY_SEPARATOR.$directory; |
131 | 131 | |
132 | - if (! File::isDirectory($path)) { |
|
132 | + if (!File::isDirectory($path)) { |
|
133 | 133 | File::makeDirectory($path, 0777, true, true); |
134 | 134 | } |
135 | 135 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | 'password' => $request->data['password'], |
38 | 38 | ]; |
39 | 39 | |
40 | - if (! Auth::attempt($credentials)) { |
|
40 | + if (!Auth::attempt($credentials)) { |
|
41 | 41 | return $this->generateError(["Email and password combination doesn't match"]); |
42 | 42 | } |
43 | 43 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | if ($collection) { |
103 | 103 | $id = $collection->_id; |
104 | - $fieldNames = (! empty($collection->fields)) ? $collection->fields->pluck('old_name')->toArray() : []; |
|
104 | + $fieldNames = (!empty($collection->fields)) ? $collection->fields->pluck('old_name')->toArray() : []; |
|
105 | 105 | |
106 | 106 | foreach ($columns as $column) { |
107 | 107 | if (in_array($column['oldName'], $fieldNames)) { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | $table = $request->table; |
255 | 255 | |
256 | - if (! is_array($table)) { |
|
256 | + if (!is_array($table)) { |
|
257 | 257 | $table = json_decode($table, true); |
258 | 258 | } |
259 | 259 |