Passed
Push — feature/lg ( f0c552...e1f115 )
by Richard
03:16
created
src/Generators/Scaffold/RoutesGenerator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     private $search;
34 34
 
35
-    public function __construct(CommandData $commandData)
35
+    public function __construct (CommandData $commandData)
36 36
     {
37 37
         $this->commandData = $commandData;
38 38
         $this->path = $commandData->config->pathRoutes;
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
             $this->routeContents .= "\n\n// Artomator Routes Start\n// Artomator Routes Stop";
43 43
         }
44 44
 
45
-        $this->routeContents = preg_replace('/(\/\/ Artomator Routes Start)(.*)(\/\/ Artomator Routes Stop)/sU', "$1\n".$this->routes.'$3', $this->routeContents);
45
+        $this->routeContents = preg_replace('/(\/\/ Artomator Routes Start)(.*)(\/\/ Artomator Routes Stop)/sU', "$1\n" . $this->routes . '$3', $this->routeContents);
46 46
     }
47 47
 
48
-    public function prepareRoutes()
48
+    public function prepareRoutes ()
49 49
     {
50
-        $fileName = $this->path.'.json';
50
+        $fileName = $this->path . '.json';
51 51
 
52 52
         if (file_exists($fileName)) {
53 53
             // Routes json exists:
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
         $this->routes = $this->buildText($fileRoutes);
88 88
     }
89 89
 
90
-    public function generate()
90
+    public function generate ()
91 91
     {
92 92
         file_put_contents($this->path, $this->routeContents);
93
-        $this->commandData->commandComment("\n".$this->commandData->config->mCamelPlural.' routes added.');
93
+        $this->commandData->commandComment("\n" . $this->commandData->config->mCamelPlural . ' routes added.');
94 94
     }
95 95
 
96
-    public function rollback()
96
+    public function rollback ()
97 97
     {
98 98
         if (Str::contains($this->routeContents, $this->routesTemplate)) {
99 99
             $this->routeContents = str_replace($this->routesTemplate, '', $this->routeContents);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }
103 103
     }
104 104
 
105
-    private function buildText($routes, $indent = 0)
105
+    private function buildText ($routes, $indent = 0)
106 106
     {
107 107
         $templateString = '';
108 108
         foreach ($routes as $route_key => $route) {
Please login to merge, or discard this patch.