Passed
Push — master ( 0e891d...e9b6b0 )
by CodexShaper
05:21
created
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.