Completed
Push — master ( e070b7...fc23f0 )
by Rougin
13:33
created
bin/combustor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 $app->console->setVersion('1.2.0');
14 14
 
15 15
 $app
16
-    ->setTemplatePath(__DIR__ . '/../src/Templates')
17
-    ->setCommandPath(__DIR__ . '/../src/Commands')
16
+    ->setTemplatePath(__DIR__.'/../src/Templates')
17
+    ->setCommandPath(__DIR__.'/../src/Commands')
18 18
     ->setCommandNamespace('Rougin\Combustor\Commands');
19 19
 
20
-$app->injector->delegate('Rougin\Describe\Describe', function () {
20
+$app->injector->delegate('Rougin\Describe\Describe', function() {
21 21
     $ci = Rougin\SparkPlug\Instance::create();
22 22
 
23 23
     $ci->load->database();
Please login to merge, or discard this patch.
src/Common/Tools.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public static function hasLayout()
21 21
     {
22
-        $header = APPPATH . 'views/layout/header.php';
23
-        $footer = APPPATH . 'views/layout/footer.php';
22
+        $header = APPPATH.'views/layout/header.php';
23
+        $footer = APPPATH.'views/layout/footer.php';
24 24
 
25 25
         return file_exists($header) && file_exists($footer);
26 26
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public static function ignite()
34 34
     {
35 35
         // Gets data from application/config/config.php
36
-        $config = file_get_contents(APPPATH . 'config/config.php');
36
+        $config = file_get_contents(APPPATH.'config/config.php');
37 37
 
38 38
         $search = ['$config[\'composer_autoload\'] = FALSE;'];
39 39
         $replace = ['$config[\'composer_autoload\'] = realpath(\'vendor\') . \'/autoload.php\';'];
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
         }
59 59
 
60 60
         $config = str_replace($search, $replace, $config);
61
-        file_put_contents(APPPATH . 'config/config.php', $config);
61
+        file_put_contents(APPPATH.'config/config.php', $config);
62 62
 
63 63
         // Gets data from application/config/autoload.php
64
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
64
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
65 65
         $lines = explode(PHP_EOL, $autoload);
66 66
 
67 67
         // Gets the currently included libraries.
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         // Includes the added libraries all back to autoload.php.
82 82
         $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
83
-        $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');';
83
+        $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
84 84
 
85 85
         $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
86 86
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         preg_match_all($pattern, $lines[85], $match);
91 91
 
92
-        $defaultHelpers = [ '\'form\'', '\'url\'', ];
92
+        $defaultHelpers = ['\'form\'', '\'url\'', ];
93 93
         $helpers = explode(', ', end($match[1]));
94 94
 
95 95
         foreach ($defaultHelpers as $helper) {
@@ -102,15 +102,15 @@  discard block
 block discarded – undo
102 102
 
103 103
         // Include the added helpers all back to autoload.php
104 104
         $pattern = '/\$autoload\[\'helper\'\] = array\([^)]*\);/';
105
-        $replacement = '$autoload[\'helper\'] = array(' . implode(', ', $helpers) . ');';
105
+        $replacement = '$autoload[\'helper\'] = array('.implode(', ', $helpers).');';
106 106
 
107 107
         preg_replace($pattern, $replacement, $lines[60]);
108 108
 
109
-        file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
109
+        file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
110 110
 
111 111
         // Creates a new .htaccess file if it does not exists.
112 112
         if ( ! file_exists('.htaccess')) {
113
-            $template = __DIR__ . '/../Templates/Htaccess.template';
113
+            $template = __DIR__.'/../Templates/Htaccess.template';
114 114
 
115 115
             $file = fopen('.htaccess', 'wb');
116 116
             $contents = file_get_contents($template);
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
         }
122 122
 
123 123
         // Creates a configuration for the Pagination library.
124
-        if ( ! file_exists(APPPATH . 'config/pagination.php')) {
125
-            $pagination = APPPATH . 'config/pagination.php';
126
-            $template = __DIR__ . '/../Templates/Pagination.template';
124
+        if ( ! file_exists(APPPATH.'config/pagination.php')) {
125
+            $pagination = APPPATH.'config/pagination.php';
126
+            $template = __DIR__.'/../Templates/Pagination.template';
127 127
 
128 128
             $file = fopen($pagination, 'wb');
129 129
             $contents = file_get_contents($template);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public static function isDoctrineEnabled()
153 153
     {
154
-        return file_exists(APPPATH . 'libraries/Doctrine.php');
154
+        return file_exists(APPPATH.'libraries/Doctrine.php');
155 155
     }
156 156
 
157 157
     /**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      */
162 162
     public static function isWildfireEnabled()
163 163
     {
164
-        return file_exists(APPPATH . 'libraries/Wildfire.php');
164
+        return file_exists(APPPATH.'libraries/Wildfire.php');
165 165
     }
166 166
 
167 167
     /**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public static function removeLibrary($type)
187 187
     {
188
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
188
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
189 189
 
190 190
         $lines = explode(PHP_EOL, $autoload);
191 191
         $pattern = '/\$autoload\[\'libraries\'\] = array\((.*?)\)/';
@@ -194,28 +194,28 @@  discard block
 block discarded – undo
194 194
 
195 195
         $libraries = explode(', ', end($match[1]));
196 196
 
197
-        if (in_array('\'' . $type . '\'', $libraries)) {
198
-            $position = array_search('\'' . $type . '\'', $libraries);
197
+        if (in_array('\''.$type.'\'', $libraries)) {
198
+            $position = array_search('\''.$type.'\'', $libraries);
199 199
 
200 200
             unset($libraries[$position]);
201 201
 
202 202
             $libraries = array_filter($libraries);
203 203
 
204 204
             $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
205
-            $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');';
205
+            $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
206 206
 
207 207
             $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
208 208
 
209
-            file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
209
+            file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
210 210
         }
211 211
 
212 212
         if ($type == 'doctrine') {
213 213
             system('composer remove doctrine/orm');
214 214
         }
215 215
 
216
-        unlink(APPPATH . 'libraries/' . ucfirst($type) . '.php');
216
+        unlink(APPPATH.'libraries/'.ucfirst($type).'.php');
217 217
 
218
-        return ucfirst($type) . ' is now successfully removed!';
218
+        return ucfirst($type).' is now successfully removed!';
219 219
     }
220 220
 
221 221
     /**
Please login to merge, or discard this patch.
src/Generator/BaseGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     protected function getPrimaryKey(array $data, $field, $referencedTable)
44 44
     {
45
-        $accessor = 'get_' . $this->describe->getPrimaryKey($referencedTable);
45
+        $accessor = 'get_'.$this->describe->getPrimaryKey($referencedTable);
46 46
 
47 47
         $data['primaryKeys'][$field] = $accessor;
48 48
 
@@ -67,15 +67,15 @@  discard block
 block discarded – undo
67 67
         if ($type == 'camelize') {
68 68
             return [
69 69
                 'field' => lcfirst(camelize($field)),
70
-                'accessor' => lcfirst(camelize('get_' . $field)),
71
-                'mutator' => lcfirst(camelize('set_' . $field))
70
+                'accessor' => lcfirst(camelize('get_'.$field)),
71
+                'mutator' => lcfirst(camelize('set_'.$field))
72 72
             ];
73 73
         }
74 74
 
75 75
         return [
76 76
             'field' => lcfirst(underscore($field)),
77
-            'accessor' => lcfirst(underscore('get_' . $field)),
78
-            'mutator' => lcfirst(underscore('set_' . $field))
77
+            'accessor' => lcfirst(underscore('get_'.$field)),
78
+            'mutator' => lcfirst(underscore('set_'.$field))
79 79
         ];
80 80
     }
81 81
 }
Please login to merge, or discard this patch.