Completed
Push — master ( f3af33...267f53 )
by Rougin
03:52
created
src/Common/Tools.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public static function hasLayout()
23 23
     {
24
-        $header = APPPATH . 'views/layout/header.php';
25
-        $footer = APPPATH . 'views/layout/footer.php';
24
+        $header = APPPATH.'views/layout/header.php';
25
+        $footer = APPPATH.'views/layout/footer.php';
26 26
 
27 27
         return file_exists($header) && file_exists($footer);
28 28
     }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public static function ignite()
36 36
     {
37 37
         // Gets data from application/config/config.php
38
-        $config = file_get_contents(APPPATH . 'config/config.php');
38
+        $config = file_get_contents(APPPATH.'config/config.php');
39 39
 
40 40
         $search = ['$config[\'composer_autoload\'] = FALSE;'];
41 41
         $replace = ['$config[\'composer_autoload\'] = realpath(\'vendor\') . \'/autoload.php\';'];
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         }
61 61
 
62 62
         $config = str_replace($search, $replace, $config);
63
-        file_put_contents(APPPATH . 'config/config.php', $config);
63
+        file_put_contents(APPPATH.'config/config.php', $config);
64 64
 
65 65
         // Gets data from application/config/autoload.php
66
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
66
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
67 67
         $lines = explode(PHP_EOL, $autoload);
68 68
 
69 69
         // Gets the currently included libraries.
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         // Includes the added libraries all back to autoload.php.
84 84
         $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
85
-        $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');';
85
+        $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
86 86
 
87 87
         $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
88 88
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         preg_match_all($pattern, $lines[85], $match);
93 93
 
94
-        $defaultHelpers = [ '\'form\'', '\'url\'', ];
94
+        $defaultHelpers = ['\'form\'', '\'url\'', ];
95 95
         $helpers = explode(', ', end($match[1]));
96 96
 
97 97
         foreach ($defaultHelpers as $helper) {
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
         // Include the added helpers all back to autoload.php
106 106
         $pattern = '/\$autoload\[\'helpers\'\] = array\([^)]*\);/';
107
-        $replacement = '$autoload[\'helpers\'] = array(' . implode(', ', $helpers) . ');';
107
+        $replacement = '$autoload[\'helpers\'] = array('.implode(', ', $helpers).');';
108 108
 
109 109
         preg_replace($pattern, $replacement, $lines[60]);
110 110
 
111
-        file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
111
+        file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
112 112
 
113 113
         // Creates a new .htaccess file if it does not exists.
114 114
         if ( ! file_exists('.htaccess')) {
115
-            $template = __DIR__ . '/../Templates/Htaccess.template';
115
+            $template = __DIR__.'/../Templates/Htaccess.template';
116 116
 
117 117
             $file = fopen('.htaccess', 'wb');
118 118
             $contents = file_get_contents($template);
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         // Creates a configuration for the Pagination library.
126
-        if ( ! file_exists(APPPATH . 'config/pagination.php')) {
127
-            $pagination = APPPATH . 'config/pagination.php';
128
-            $template = __DIR__ . '/../Templates/Pagination.template';
126
+        if ( ! file_exists(APPPATH.'config/pagination.php')) {
127
+            $pagination = APPPATH.'config/pagination.php';
128
+            $template = __DIR__.'/../Templates/Pagination.template';
129 129
 
130 130
             $file = fopen($pagination, 'wb');
131 131
             $contents = file_get_contents($template);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public static function isDoctrineEnabled()
155 155
     {
156
-        return file_exists(APPPATH . 'libraries/Doctrine.php');
156
+        return file_exists(APPPATH.'libraries/Doctrine.php');
157 157
     }
158 158
 
159 159
     /**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public static function isWildfireEnabled()
165 165
     {
166
-        return file_exists(APPPATH . 'libraries/Wildfire.php');
166
+        return file_exists(APPPATH.'libraries/Wildfire.php');
167 167
     }
168 168
 
169 169
     /**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public static function removeLibrary($type)
189 189
     {
190
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
190
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
191 191
 
192 192
         $lines = explode(PHP_EOL, $autoload);
193 193
         $pattern = '/\$autoload\[\'libraries\'\] = array\((.*?)\)/';
@@ -196,28 +196,28 @@  discard block
 block discarded – undo
196 196
 
197 197
         $libraries = explode(', ', end($match[1]));
198 198
 
199
-        if (in_array('\'' . $type . '\'', $libraries)) {
200
-            $position = array_search('\'' . $type . '\'', $libraries);
199
+        if (in_array('\''.$type.'\'', $libraries)) {
200
+            $position = array_search('\''.$type.'\'', $libraries);
201 201
 
202 202
             unset($libraries[$position]);
203 203
 
204 204
             $libraries = array_filter($libraries);
205 205
 
206 206
             $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
207
-            $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');';
207
+            $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
208 208
 
209 209
             $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
210 210
 
211
-            file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
211
+            file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
212 212
         }
213 213
 
214 214
         if ($type == 'doctrine') {
215 215
             system('composer remove doctrine/orm');
216 216
         }
217 217
 
218
-        unlink(APPPATH . 'libraries/' . ucfirst($type) . '.php');
218
+        unlink(APPPATH.'libraries/'.ucfirst($type).'.php');
219 219
 
220
-        return ucfirst($type) . ' is now successfully removed!';
220
+        return ucfirst($type).' is now successfully removed!';
221 221
     }
222 222
 
223 223
     /**
Please login to merge, or discard this patch.
src/Generator/ControllerGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
             }
52 52
 
53 53
             $field = strtolower($column->getField());
54
-            $method = 'set_' . $field;
54
+            $method = 'set_'.$field;
55 55
 
56 56
             $this->data['camel'][$field] = lcfirst(camelize($method));
57 57
             $this->data['underscore'][$field] = underscore($method);
Please login to merge, or discard this patch.
src/Generator/ViewGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
         $data['plural'] = plural($data['name']);
45 45
         $data['singular'] = singular($data['name']);
46 46
 
47
-        $data['primaryKey'] = 'get_' . $this->describe->getPrimaryKey(
47
+        $data['primaryKey'] = 'get_'.$this->describe->getPrimaryKey(
48 48
             $data['name']
49 49
         );
50 50
 
51 51
         // Workaround...
52 52
         if ($data['primaryKey'] == 'get_') {
53
-            $data['primaryKey'] = 'get_' . $this->describe->getPrimaryKey(
53
+            $data['primaryKey'] = 'get_'.$this->describe->getPrimaryKey(
54 54
                 singular($data['name'])
55 55
             );
56 56
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
                 $this->data['foreignKeys'][$field] = plural($referencedTable);
102 102
 
103
-                $singular = $field . '_singular';
103
+                $singular = $field.'_singular';
104 104
 
105 105
                 $this->data['foreignKeys'][$singular] = singular(
106 106
                     $referencedTable
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('set_' . $field)),
71
-                'mutator' => lcfirst(camelize('get_' . $field))
70
+                'accessor' => lcfirst(camelize('set_'.$field)),
71
+                'mutator' => lcfirst(camelize('get_'.$field))
72 72
             ];
73 73
         }
74 74
 
75 75
         return [
76 76
             'field' => lcfirst(underscore($field)),
77
-            'accessor' => lcfirst(underscore('set_' . $field)),
78
-            'mutator' => lcfirst(underscore('get_' . $field))
77
+            'accessor' => lcfirst(underscore('set_'.$field)),
78
+            'mutator' => lcfirst(underscore('get_'.$field))
79 79
         ];
80 80
     }
81 81
 }
Please login to merge, or discard this patch.