@@ -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 | } |
@@ -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 | } |
@@ -2,19 +2,19 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | require 'vendor/autoload.php'; |
| 4 | 4 | |
| 5 | -$directory = __DIR__ . '/../build'; // TEST DIRECTORY |
|
| 5 | +$directory = __DIR__.'/../build'; // TEST DIRECTORY |
|
| 6 | 6 | |
| 7 | 7 | Rougin\SparkPlug\Instance::create($directory); |
| 8 | 8 | |
| 9 | 9 | $basePath = BASEPATH; |
| 10 | 10 | |
| 11 | -require APPPATH . 'config/database.php'; |
|
| 11 | +require APPPATH.'config/database.php'; |
|
| 12 | 12 | |
| 13 | 13 | if (is_dir('vendor/rougin/codeigniter/src/')) { |
| 14 | 14 | $basePath = 'vendor/rougin/codeigniter/src/'; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -require $basePath . 'helpers/inflector_helper.php'; |
|
| 17 | +require $basePath.'helpers/inflector_helper.php'; |
|
| 18 | 18 | |
| 19 | 19 | $driver = new Rougin\Describe\Driver\CodeIgniterDriver($db[$active_group]); |
| 20 | 20 | $injector = new Auryn\Injector; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $combustor = Rougin\Blueprint\Console::boot('combustor.yml', $injector, $directory); |
| 25 | 25 | |
| 26 | -$extensions = [ new Rougin\Combustor\Common\InflectorExtension ]; |
|
| 26 | +$extensions = [new Rougin\Combustor\Common\InflectorExtension]; |
|
| 27 | 27 | $template = $combustor->getTemplatePath(); |
| 28 | 28 | |
| 29 | 29 | $combustor->setTemplatePath($template, null, $extensions); |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | protected function execute(InputInterface $input, OutputInterface $output) |
| 39 | 39 | { |
| 40 | - $commands = [ 'make:controller', 'make:model', 'make:view' ]; |
|
| 40 | + $commands = ['make:controller', 'make:model', 'make:view']; |
|
| 41 | 41 | |
| 42 | 42 | foreach ($commands as $command) { |
| 43 | - $arguments = [ 'command' => $command, 'table' => $input->getArgument('table') ]; |
|
| 43 | + $arguments = ['command' => $command, 'table' => $input->getArgument('table')]; |
|
| 44 | 44 | $arrayInput = new ArrayInput($arguments); |
| 45 | 45 | |
| 46 | 46 | $application = $this->getApplication()->find($command); |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | public function getFilters() |
| 19 | 19 | { |
| 20 | 20 | return array( |
| 21 | - 'plural' => new \Twig_SimpleFilter('plural', [ $this, 'toPluralFormat' ]), |
|
| 22 | - 'singular' => new \Twig_SimpleFilter('singular', [ $this, 'toSingularFormat' ]), |
|
| 23 | - 'title' => new \Twig_SimpleFilter('title', [ $this, 'toTitleCase' ]), |
|
| 24 | - 'underscore' => new \Twig_SimpleFilter('underscore', [ $this, 'toUnderscoreCase' ]), |
|
| 21 | + 'plural' => new \Twig_SimpleFilter('plural', [$this, 'toPluralFormat']), |
|
| 22 | + 'singular' => new \Twig_SimpleFilter('singular', [$this, 'toSingularFormat']), |
|
| 23 | + 'title' => new \Twig_SimpleFilter('title', [$this, 'toTitleCase']), |
|
| 24 | + 'underscore' => new \Twig_SimpleFilter('underscore', [$this, 'toUnderscoreCase']), |
|
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | 27 | |