Completed
Push — master ( f9982c...f3af33 )
by Rougin
03:48
created
src/Generator/ViewGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
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
         }
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
                     $referencedTable
103 103
                 );
104 104
 
105
-                $singular = $field . '_singular';
105
+                $singular = $field.'_singular';
106 106
 
107 107
                 $this->data['foreignKeys'][$singular] = singular(
108 108
                     $referencedTable
109 109
                 );
110 110
 
111
-                $this->data['primaryKeys'][$field] = 'get_' .
111
+                $this->data['primaryKeys'][$field] = 'get_'.
112 112
                     $this->describe->getPrimaryKey($referencedTable);
113 113
 
114 114
                 if ($this->data['isCamel']) {
Please login to merge, or discard this patch.
src/Generator/BaseGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
         if ($type == 'camelize') {
45 45
             return [
46 46
                 'field' => lcfirst(camelize($field)),
47
-                'accessor' => lcfirst(camelize('set_' . $field)),
48
-                'mutator' => lcfirst(camelize('get_' . $field))
47
+                'accessor' => lcfirst(camelize('set_'.$field)),
48
+                'mutator' => lcfirst(camelize('get_'.$field))
49 49
             ];
50 50
         }
51 51
 
52 52
         return [
53 53
             'field' => lcfirst(underscore($field)),
54
-            'accessor' => lcfirst(underscore('set_' . $field)),
55
-            'mutator' => lcfirst(underscore('get_' . $field))
54
+            'accessor' => lcfirst(underscore('set_'.$field)),
55
+            'mutator' => lcfirst(underscore('get_'.$field))
56 56
         ];
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Commands/InstallDoctrineCommand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
          * library and creates a "proxies" directory for lazy loading.
43 43
          */
44 44
 
45
-        file_put_contents(realpath('vendor') . '/bin/doctrine.php', $cli);
46
-        file_put_contents(realpath('vendor') . '/doctrine/orm/bin/doctrine.php', $cli);
45
+        file_put_contents(realpath('vendor').'/bin/doctrine.php', $cli);
46
+        file_put_contents(realpath('vendor').'/doctrine/orm/bin/doctrine.php', $cli);
47 47
 
48
-        $file = fopen(APPPATH . 'libraries/Doctrine.php', 'wb');
49
-        file_put_contents(APPPATH . 'libraries/Doctrine.php', $library);
48
+        $file = fopen(APPPATH.'libraries/Doctrine.php', 'wb');
49
+        file_put_contents(APPPATH.'libraries/Doctrine.php', $library);
50 50
         fclose($file);
51 51
 
52 52
         $this->addLibrary('doctrine');
53 53
 
54
-        if ( ! is_dir(APPPATH . 'models/proxies')) {
55
-            mkdir(APPPATH . 'models/proxies');
56
-            chmod(APPPATH . 'models/proxies', 0777);
54
+        if ( ! is_dir(APPPATH.'models/proxies')) {
55
+            mkdir(APPPATH.'models/proxies');
56
+            chmod(APPPATH.'models/proxies', 0777);
57 57
         }
58 58
 
59 59
         /*
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
          */
62 62
 
63 63
         $abstractCommand = file_get_contents(
64
-            realpath('vendor') . '/' .
64
+            realpath('vendor').'/'.
65 65
             'doctrine/orm/lib/Doctrine/'.
66 66
             'ORM/Tools/Console/Command/'.
67 67
             'SchemaTool/AbstractCommand.php'
68 68
         );
69 69
 
70 70
         $search  = 'use Doctrine\ORM\Tools\SchemaTool;';
71
-        $replace = $search . "\n" . 'include BASEPATH . \'core/Model.php\';';
71
+        $replace = $search."\n".'include BASEPATH . \'core/Model.php\';';
72 72
 
73 73
         $contents = $abstractCommand;
74 74
         $schemaTool = 'use Doctrine\ORM\Tools\SchemaTool;';
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         }
82 82
 
83 83
         file_put_contents(
84
-            realpath('vendor') . '/' .
84
+            realpath('vendor').'/'.
85 85
             'doctrine/orm/lib/Doctrine/'.
86 86
             'ORM/Tools/Console/Command/'.
87 87
             'SchemaTool/AbstractCommand.php',
@@ -92,6 +92,6 @@  discard block
 block discarded – undo
92 92
 
93 93
         $message = 'Doctrine ORM is now installed successfully!';
94 94
 
95
-        return $output->writeln('<info>' . $message . '</info>');
95
+        return $output->writeln('<info>'.$message.'</info>');
96 96
     }
97 97
 }
Please login to merge, or discard this patch.
src/Commands/CreateLayoutCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     protected function execute(InputInterface $input, OutputInterface $output)
60 60
     {
61
-        $layoutPath = APPPATH . 'views/layout';
61
+        $layoutPath = APPPATH.'views/layout';
62 62
 
63 63
         $data = [];
64 64
 
@@ -95,23 +95,23 @@  discard block
 block discarded – undo
95 95
         if ( ! @mkdir($layoutPath, 0777, true)) {
96 96
             $message = 'The layout directory already exists!';
97 97
 
98
-            return $output->writeln('<error>' . $message . '</error>');
98
+            return $output->writeln('<error>'.$message.'</error>');
99 99
         }
100 100
 
101 101
         $header = $this->renderer->render('Views/Layout/header.template', $data);
102 102
         $footer = $this->renderer->render('Views/Layout/footer.template', $data);
103 103
 
104
-        $headerFile = fopen($layoutPath . '/header.php', 'wb');
105
-        $footerFile = fopen($layoutPath . '/footer.php', 'wb');
104
+        $headerFile = fopen($layoutPath.'/header.php', 'wb');
105
+        $footerFile = fopen($layoutPath.'/footer.php', 'wb');
106 106
 
107
-        file_put_contents($layoutPath . '/header.php', $header);
108
-        file_put_contents($layoutPath . '/footer.php', $footer);
107
+        file_put_contents($layoutPath.'/header.php', $header);
108
+        file_put_contents($layoutPath.'/footer.php', $footer);
109 109
 
110 110
         fclose($headerFile);
111 111
         fclose($footerFile);
112 112
 
113 113
         $message = 'The layout folder has been created successfully!';
114 114
 
115
-        return $output->writeln('<info>' . $message . '</info>');
115
+        return $output->writeln('<info>'.$message.'</info>');
116 116
     }
117 117
 }
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
@@ -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\';'];
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         $config = str_replace($search, $replace, $config);
56
-        file_put_contents(APPPATH . 'config/config.php', $config);
56
+        file_put_contents(APPPATH.'config/config.php', $config);
57 57
 
58 58
         // Gets data from application/config/autoload.php
59
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
59
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
60 60
         $lines = explode(PHP_EOL, $autoload);
61 61
 
62 62
         // Gets the currently included libraries.
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         // Includes the added libraries all back to autoload.php.
77 77
         $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
78
-        $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries) . ');';
78
+        $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
79 79
 
80 80
         $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
81 81
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         preg_match_all($pattern, $lines[85], $match);
86 86
 
87
-        $defaultHelpers = [ '\'form\'', '\'url\'', ];
87
+        $defaultHelpers = ['\'form\'', '\'url\'', ];
88 88
         $helpers = explode(', ', end($match[1]));
89 89
 
90 90
         foreach ($defaultHelpers as $helper) {
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 
98 98
         // Include the added helpers all back to autoload.php
99 99
         $pattern = '/\$autoload\[\'helpers\'\] = array\([^)]*\);/';
100
-        $replacement = '$autoload[\'helpers\'] = array('.implode(', ', $helpers) . ');';
100
+        $replacement = '$autoload[\'helpers\'] = array('.implode(', ', $helpers).');';
101 101
 
102 102
         preg_replace($pattern, $replacement, $lines[60]);
103 103
 
104
-        file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
104
+        file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
105 105
 
106 106
         // Creates a new .htaccess file if it does not exists.
107 107
         if ( ! file_exists('.htaccess')) {
108
-            $template = __DIR__ . '/../Templates/Htaccess.template';
108
+            $template = __DIR__.'/../Templates/Htaccess.template';
109 109
 
110 110
             $file = fopen('.htaccess', 'wb');
111 111
             $contents = file_get_contents($template);
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
         }
117 117
 
118 118
         // Creates a configuration for the Pagination library.
119
-        if ( ! file_exists(APPPATH . 'config/pagination.php')) {
120
-            $pagination = APPPATH . 'config/pagination.php';
121
-            $template = __DIR__ . '/../Templates/Pagination.template';
119
+        if ( ! file_exists(APPPATH.'config/pagination.php')) {
120
+            $pagination = APPPATH.'config/pagination.php';
121
+            $template = __DIR__.'/../Templates/Pagination.template';
122 122
 
123 123
             $file = fopen($pagination, 'wb');
124 124
             $contents = file_get_contents($template);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public static function isDoctrineEnabled()
148 148
     {
149
-        return file_exists(APPPATH . 'libraries/Doctrine.php');
149
+        return file_exists(APPPATH.'libraries/Doctrine.php');
150 150
     }
151 151
 
152 152
     /**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public static function isWildfireEnabled()
158 158
     {
159
-        return file_exists(APPPATH . 'libraries/Wildfire.php');
159
+        return file_exists(APPPATH.'libraries/Wildfire.php');
160 160
     }
161 161
 
162 162
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public static function removeLibrary($type)
182 182
     {
183
-        $autoload = file_get_contents(APPPATH . 'config/autoload.php');
183
+        $autoload = file_get_contents(APPPATH.'config/autoload.php');
184 184
 
185 185
         $lines = explode(PHP_EOL, $autoload);
186 186
         $pattern = '/\$autoload\[\'libraries\'\] = array\((.*?)\)/';
@@ -189,28 +189,28 @@  discard block
 block discarded – undo
189 189
 
190 190
         $libraries = explode(', ', end($match[1]));
191 191
 
192
-        if (in_array('\'' . $type . '\'', $libraries)) {
193
-            $position = array_search('\'' . $type . '\'', $libraries);
192
+        if (in_array('\''.$type.'\'', $libraries)) {
193
+            $position = array_search('\''.$type.'\'', $libraries);
194 194
 
195 195
             unset($libraries[$position]);
196 196
 
197 197
             $libraries = array_filter($libraries);
198 198
 
199 199
             $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/';
200
-            $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');';
200
+            $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');';
201 201
 
202 202
             $lines[60] = preg_replace($pattern, $replacement, $lines[60]);
203 203
 
204
-            file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines));
204
+            file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines));
205 205
         }
206 206
 
207 207
         if ($type == 'doctrine') {
208 208
             system('composer remove doctrine/orm');
209 209
         }
210 210
 
211
-        unlink(APPPATH . 'libraries/' . ucfirst($type) . '.php');
211
+        unlink(APPPATH.'libraries/'.ucfirst($type).'.php');
212 212
 
213
-        return ucfirst($type) . ' is now successfully removed!';
213
+        return ucfirst($type).' is now successfully removed!';
214 214
     }
215 215
 
216 216
     /**
Please login to merge, or discard this patch.