@@ -58,7 +58,7 @@ discard block |
||
| 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,17 +95,17 @@ discard block |
||
| 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); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $fileName = ucfirst($input->getArgument('name')); |
| 86 | 86 | |
| 87 | - $path = APPPATH . 'models' . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 87 | + $path = APPPATH.'models'.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 88 | 88 | |
| 89 | 89 | $fileInformation = [ |
| 90 | 90 | 'name' => $fileName, |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if ($validator->fails()) { |
| 103 | 103 | $message = $validator->getMessage(); |
| 104 | 104 | |
| 105 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 105 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $data = [ |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | $result = $generator->generate(); |
| 118 | 118 | $model = $this->renderer->render('Model.template', $result); |
| 119 | - $message = 'The model "' . $fileName . '" has been created successfully!'; |
|
| 119 | + $message = 'The model "'.$fileName.'" has been created successfully!'; |
|
| 120 | 120 | |
| 121 | 121 | $file = fopen($path, 'wb'); |
| 122 | 122 | file_put_contents($path, $model); |
| 123 | 123 | fclose($file); |
| 124 | 124 | |
| 125 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 125 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 126 | 126 | } |
| 127 | 127 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $fileName = ucfirst(Inflector::plural($input->getArgument('name'))); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $path = APPPATH . 'controllers' . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 95 | + $path = APPPATH.'controllers'.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 96 | 96 | |
| 97 | 97 | $fileInformation = [ |
| 98 | 98 | 'name' => $fileName, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($validator->fails()) { |
| 111 | 111 | $message = $validator->getMessage(); |
| 112 | 112 | |
| 113 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 113 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $data = [ |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $result = $generator->generate(); |
| 127 | 127 | $controller = $this->renderer->render('Controller.template', $result); |
| 128 | - $message = 'The controller "' . $fileName . '" has been created successfully!'; |
|
| 128 | + $message = 'The controller "'.$fileName.'" has been created successfully!'; |
|
| 129 | 129 | |
| 130 | 130 | $file = fopen($path, 'wb'); |
| 131 | 131 | file_put_contents($path, $controller); |
| 132 | 132 | fclose($file); |
| 133 | 133 | |
| 134 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 134 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if ($validator->fails()) { |
| 87 | 87 | $message = $validator->getMessage(); |
| 88 | 88 | |
| 89 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 89 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $data = [ |
@@ -106,26 +106,26 @@ discard block |
||
| 106 | 106 | 'show' => $this->renderer->render('Views/show.template', $result) |
| 107 | 107 | ]; |
| 108 | 108 | |
| 109 | - $filePath = APPPATH . 'views/' . $name; |
|
| 109 | + $filePath = APPPATH.'views/'.$name; |
|
| 110 | 110 | |
| 111 | - $file = fopen($filePath . '/create.php', 'wb'); |
|
| 112 | - file_put_contents($filePath . '/create.php', $results['create']); |
|
| 111 | + $file = fopen($filePath.'/create.php', 'wb'); |
|
| 112 | + file_put_contents($filePath.'/create.php', $results['create']); |
|
| 113 | 113 | fclose($file); |
| 114 | 114 | |
| 115 | - $file = fopen($filePath . '/edit.php', 'wb'); |
|
| 116 | - file_put_contents($filePath . '/edit.php', $results['edit']); |
|
| 115 | + $file = fopen($filePath.'/edit.php', 'wb'); |
|
| 116 | + file_put_contents($filePath.'/edit.php', $results['edit']); |
|
| 117 | 117 | fclose($file); |
| 118 | 118 | |
| 119 | - $file = fopen($filePath . '/index.php', 'wb'); |
|
| 120 | - file_put_contents($filePath . '/index.php', $results['index']); |
|
| 119 | + $file = fopen($filePath.'/index.php', 'wb'); |
|
| 120 | + file_put_contents($filePath.'/index.php', $results['index']); |
|
| 121 | 121 | fclose($file); |
| 122 | 122 | |
| 123 | - $file = fopen($filePath . '/show.php', 'wb'); |
|
| 124 | - file_put_contents($filePath . '/show.php', $results['show']); |
|
| 123 | + $file = fopen($filePath.'/show.php', 'wb'); |
|
| 124 | + file_put_contents($filePath.'/show.php', $results['show']); |
|
| 125 | 125 | fclose($file); |
| 126 | 126 | |
| 127 | - $message = 'The views folder "' . $name . '" has been created successfully!'; |
|
| 127 | + $message = 'The views folder "'.$name.'" has been created successfully!'; |
|
| 128 | 128 | |
| 129 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 129 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | protected function configure() |
| 49 | 49 | { |
| 50 | 50 | $this |
| 51 | - ->setName('remove:' . $this->library) |
|
| 52 | - ->setDescription('Removes ' . ucfirst($this->library)); |
|
| 51 | + ->setName('remove:'.$this->library) |
|
| 52 | + ->setDescription('Removes '.ucfirst($this->library)); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -63,6 +63,6 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $message = Tools::removeLibrary($this->library); |
| 65 | 65 | |
| 66 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 66 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public static function camelize($string) |
| 22 | 22 | { |
| 23 | - return strtolower($string[0]) . substr(str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', $string))), 1); |
|
| 23 | + return strtolower($string[0]).substr(str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', $string))), 1); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -38,25 +38,25 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $rules = [ |
| 41 | - '/(quiz)$/' => '\1zes', // quizzes |
|
| 42 | - '/^(ox)$/' => '\1\2en', // ox |
|
| 43 | - '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 44 | - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 45 | - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 46 | - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 47 | - '/(hive)$/' => '\1s', // archive, hive |
|
| 48 | - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 49 | - '/sis$/' => 'ses', // basis, diagnosis |
|
| 50 | - '/([ti])um$/' => '\1a', // datum, medium |
|
| 51 | - '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 52 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 53 | - '/(c)hild$/' => '\1hildren', // child |
|
| 54 | - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 55 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 56 | - '/(alias|status|virus)$/' => '\1es', // alias |
|
| 57 | - '/(octop)us$/' => '\1i', // octopus |
|
| 58 | - '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 59 | - '/s$/' => 's', // no change (compatibility) |
|
| 41 | + '/(quiz)$/' => '\1zes', // quizzes |
|
| 42 | + '/^(ox)$/' => '\1\2en', // ox |
|
| 43 | + '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 44 | + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 45 | + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 46 | + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 47 | + '/(hive)$/' => '\1s', // archive, hive |
|
| 48 | + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 49 | + '/sis$/' => 'ses', // basis, diagnosis |
|
| 50 | + '/([ti])um$/' => '\1a', // datum, medium |
|
| 51 | + '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 52 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 53 | + '/(c)hild$/' => '\1hildren', // child |
|
| 54 | + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 55 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 56 | + '/(alias|status|virus)$/' => '\1es', // alias |
|
| 57 | + '/(octop)us$/' => '\1i', // octopus |
|
| 58 | + '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 59 | + '/s$/' => 's', // no change (compatibility) |
|
| 60 | 60 | '/$/' => 's', |
| 61 | 61 | ]; |
| 62 | 62 | |
@@ -21,8 +21,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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. |
@@ -84,7 +84,7 @@ discard block |
||
| 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) { |
@@ -101,11 +101,11 @@ discard block |
||
| 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); |
@@ -115,9 +115,9 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Creates a configuration for the Pagination library. |
| 118 | - if ( ! file_exists(APPPATH . 'config/pagination.php')) { |
|
| 119 | - $pagination = APPPATH . 'config/pagination.php'; |
|
| 120 | - $template = __DIR__ . '/../Templates/Pagination.template'; |
|
| 118 | + if ( ! file_exists(APPPATH.'config/pagination.php')) { |
|
| 119 | + $pagination = APPPATH.'config/pagination.php'; |
|
| 120 | + $template = __DIR__.'/../Templates/Pagination.template'; |
|
| 121 | 121 | |
| 122 | 122 | $file = fopen($pagination, 'wb'); |
| 123 | 123 | $contents = file_get_contents($template); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public static function isDoctrineEnabled() |
| 146 | 146 | { |
| 147 | - return file_exists(APPPATH . 'libraries/Doctrine.php'); |
|
| 147 | + return file_exists(APPPATH.'libraries/Doctrine.php'); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public static function isWildfireEnabled() |
| 156 | 156 | { |
| 157 | - return file_exists(APPPATH . 'libraries/Wildfire.php'); |
|
| 157 | + return file_exists(APPPATH.'libraries/Wildfire.php'); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | */ |
| 179 | 179 | public static function removeLibrary($type) |
| 180 | 180 | { |
| 181 | - $autoload = file_get_contents(APPPATH . 'config/autoload.php'); |
|
| 181 | + $autoload = file_get_contents(APPPATH.'config/autoload.php'); |
|
| 182 | 182 | |
| 183 | 183 | $lines = explode(PHP_EOL, $autoload); |
| 184 | 184 | $pattern = '/\$autoload\[\'libraries\'\] = array\((.*?)\)/'; |
@@ -187,28 +187,28 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $libraries = explode(', ', end($match[1])); |
| 189 | 189 | |
| 190 | - if (in_array('\'' . $type . '\'', $libraries)) { |
|
| 191 | - $position = array_search('\'' . $type . '\'', $libraries); |
|
| 190 | + if (in_array('\''.$type.'\'', $libraries)) { |
|
| 191 | + $position = array_search('\''.$type.'\'', $libraries); |
|
| 192 | 192 | |
| 193 | 193 | unset($libraries[$position]); |
| 194 | 194 | |
| 195 | 195 | $libraries = array_filter($libraries); |
| 196 | 196 | |
| 197 | 197 | $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/'; |
| 198 | - $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');'; |
|
| 198 | + $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');'; |
|
| 199 | 199 | |
| 200 | 200 | $lines[60] = preg_replace($pattern, $replacement, $lines[60]); |
| 201 | 201 | |
| 202 | - file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines)); |
|
| 202 | + file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines)); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if ($type == 'doctrine') { |
| 206 | 206 | system('composer remove doctrine/orm'); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - unlink(APPPATH . 'libraries/' . ucfirst($type) . '.php'); |
|
| 209 | + unlink(APPPATH.'libraries/'.ucfirst($type).'.php'); |
|
| 210 | 210 | |
| 211 | - return ucfirst($type) . ' is now successfully removed!'; |
|
| 211 | + return ucfirst($type).' is now successfully removed!'; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function fails() |
| 65 | 65 | { |
| 66 | - $hasDoctrine = file_exists(APPPATH . 'libraries/Doctrine.php'); |
|
| 67 | - $hasWildfire = file_exists(APPPATH . 'libraries/Wildfire.php'); |
|
| 66 | + $hasDoctrine = file_exists(APPPATH.'libraries/Doctrine.php'); |
|
| 67 | + $hasWildfire = file_exists(APPPATH.'libraries/Wildfire.php'); |
|
| 68 | 68 | |
| 69 | 69 | if ( ! $hasWildfire && ! $hasDoctrine) { |
| 70 | 70 | $this->message = 'Please install Wildfire or Doctrine!'; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $name = $this->file['name']; |
| 83 | 83 | $type = $this->file['type']; |
| 84 | 84 | |
| 85 | - $this->message = 'The "' . $name . '" ' . $type . ' already exists!'; |
|
| 85 | + $this->message = 'The "'.$name.'" '.$type.' already exists!'; |
|
| 86 | 86 | |
| 87 | 87 | return true; |
| 88 | 88 | } |
@@ -13,11 +13,11 @@ discard block |
||
| 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('CI_Controller', function () { |
|
| 20 | +$app->injector->delegate('CI_Controller', function() { |
|
| 21 | 21 | $sparkPlug = new Rougin\SparkPlug\SparkPlug($GLOBALS, $_SERVER); |
| 22 | 22 | |
| 23 | 23 | return $sparkPlug->getCodeIgniter(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $ci = $app->injector->make('CI_Controller'); |
| 27 | 27 | |
| 28 | -$app->injector->delegate('Rougin\Describe\Describe', function () use ($ci) { |
|
| 28 | +$app->injector->delegate('Rougin\Describe\Describe', function() use ($ci) { |
|
| 29 | 29 | $ci->load->database(); |
| 30 | 30 | |
| 31 | 31 | $config['default'] = [ |