@@ -83,7 +83,7 @@ |
||
| 83 | 83 | $tableInformation = $this->describe->getTable($tableName); |
| 84 | 84 | |
| 85 | 85 | if (empty($tableInformation)) { |
| 86 | - throw new TableNotFoundException('"' . $tableName . '" table not found in database!'); |
|
| 86 | + throw new TableNotFoundException('"'.$tableName.'" table not found in database!'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return $tableInformation; |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | $contents = (new DataGenerator($this->describe, $input))->generate(); |
| 41 | 41 | $filename = strtolower(plural(underscore($input->getArgument('table')))); |
| 42 | 42 | |
| 43 | - $views = [ 'create', 'edit', 'index', 'show' ]; |
|
| 43 | + $views = ['create', 'edit', 'index', 'show']; |
|
| 44 | 44 | |
| 45 | 45 | foreach ($views as $item) { |
| 46 | - $file = 'application/views/' . $filename . '/' . $item . '.php'; |
|
| 47 | - $view = $this->renderer->render('Views/' . ucfirst($item) . '.twig', $contents); |
|
| 46 | + $file = 'application/views/'.$filename.'/'.$item.'.php'; |
|
| 47 | + $view = $this->renderer->render('Views/'.ucfirst($item).'.twig', $contents); |
|
| 48 | 48 | |
| 49 | 49 | $this->filesystem->write($file, $view); |
| 50 | 50 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $filename = ucfirst(plural(underscore($input->getArgument('table')))); |
| 42 | 42 | $rendered = $this->renderer->render('Controller.twig', $contents); |
| 43 | 43 | |
| 44 | - $this->filesystem->write('application/controllers/' . $filename . '.php', $rendered); |
|
| 44 | + $this->filesystem->write('application/controllers/'.$filename.'.php', $rendered); |
|
| 45 | 45 | |
| 46 | 46 | $output->writeln('<info>Controller created successfully!</info>'); |
| 47 | 47 | } |
@@ -2,16 +2,16 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | require 'vendor/autoload.php'; |
| 4 | 4 | |
| 5 | -$directory = __DIR__ . '/../build'; // test |
|
| 5 | +$directory = __DIR__.'/../build'; // test |
|
| 6 | 6 | |
| 7 | 7 | Rougin\SparkPlug\Instance::create($directory); |
| 8 | 8 | |
| 9 | -require APPPATH . 'config/database.php'; |
|
| 9 | +require APPPATH.'config/database.php'; |
|
| 10 | 10 | |
| 11 | 11 | if (file_exists('vendor/rougin/codeigniter/src/helpers/inflector_helper.php')) { |
| 12 | 12 | require 'vendor/rougin/codeigniter/src/helpers/inflector_helper.php'; |
| 13 | 13 | } else { |
| 14 | - require BASEPATH . 'helpers/inflector_helper.php'; |
|
| 14 | + require BASEPATH.'helpers/inflector_helper.php'; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $driver = new Rougin\Describe\Driver\CodeIgniterDriver($db[$active_group]); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | $combustor = Rougin\Blueprint\Console::boot('combustor.yml', $injector, $directory); |
| 23 | 23 | |
| 24 | -$extensions = [ new Rougin\Combustor\Common\InflectorExtension ]; |
|
| 24 | +$extensions = [new Rougin\Combustor\Common\InflectorExtension]; |
|
| 25 | 25 | $template = $combustor->getTemplatePath(); |
| 26 | 26 | |
| 27 | 27 | $combustor->setTemplatePath($template, null, $extensions); |
@@ -49,9 +49,9 @@ |
||
| 49 | 49 | |
| 50 | 50 | $contents = (new DataGenerator($this->describe, $input))->generate(); |
| 51 | 51 | $filename = ucfirst(singular(underscore($input->getArgument('table')))); |
| 52 | - $rendered = $this->renderer->render($modelType . '.twig', $contents); |
|
| 52 | + $rendered = $this->renderer->render($modelType.'.twig', $contents); |
|
| 53 | 53 | |
| 54 | - $this->filesystem->write('application/models/' . $filename . '.php', $rendered); |
|
| 54 | + $this->filesystem->write('application/models/'.$filename.'.php', $rendered); |
|
| 55 | 55 | |
| 56 | 56 | $output->writeln('<info>Model created successfully!</info>'); |
| 57 | 57 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | public function getFilters() |
| 19 | 19 | { |
| 20 | 20 | return array( |
| 21 | - 'camel' => new \Twig_SimpleFilter('camel', [ $this, 'toCamelCase' ]), |
|
| 22 | - 'plural' => new \Twig_SimpleFilter('plural', [ $this, 'toPluralFormat' ]), |
|
| 23 | - 'singular' => new \Twig_SimpleFilter('singular', [ $this, 'toSingularFormat' ]), |
|
| 24 | - 'title' => new \Twig_SimpleFilter('title', [ $this, 'toTitleCase' ]), |
|
| 25 | - 'underscore' => new \Twig_SimpleFilter('underscore', [ $this, 'toUnderscoreCase' ]), |
|
| 21 | + 'camel' => new \Twig_SimpleFilter('camel', [$this, 'toCamelCase']), |
|
| 22 | + 'plural' => new \Twig_SimpleFilter('plural', [$this, 'toPluralFormat']), |
|
| 23 | + 'singular' => new \Twig_SimpleFilter('singular', [$this, 'toSingularFormat']), |
|
| 24 | + 'title' => new \Twig_SimpleFilter('title', [$this, 'toTitleCase']), |
|
| 25 | + 'underscore' => new \Twig_SimpleFilter('underscore', [$this, 'toUnderscoreCase']), |
|
| 26 | 26 | ); |
| 27 | 27 | } |
| 28 | 28 | |