@@ -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 | } |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | protected function execute(InputInterface $input, OutputInterface $output) |
| 40 | 40 | { |
| 41 | - $modelType = 'Models/' . ucfirst($input->getOption('type')); |
|
| 41 | + $modelType = 'Models/'.ucfirst($input->getOption('type')); |
|
| 42 | 42 | $contents = (new DataGenerator($this->describe, $input))->generate(); |
| 43 | 43 | $filename = ucfirst(singular(underscore($input->getArgument('table')))); |
| 44 | - $rendered = $this->renderer->render($modelType . '.twig', $contents); |
|
| 44 | + $rendered = $this->renderer->render($modelType.'.twig', $contents); |
|
| 45 | 45 | |
| 46 | - $this->filesystem->write('application/models/' . $filename . '.php', $rendered); |
|
| 46 | + $this->filesystem->write('application/models/'.$filename.'.php', $rendered); |
|
| 47 | 47 | |
| 48 | 48 | $output->writeln('<info>Model created successfully!</info>'); |
| 49 | 49 | } |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | protected function execute(InputInterface $input, OutputInterface $output) |
| 40 | 40 | { |
| 41 | - $commands = [ 'make:controller', 'make:model', 'make:view' ]; |
|
| 41 | + $commands = ['make:controller', 'make:model', 'make:view']; |
|
| 42 | 42 | |
| 43 | 43 | foreach ($commands as $command) { |
| 44 | - $arguments = [ 'command' => $command, 'table' => $input->getArgument('table') ]; |
|
| 44 | + $arguments = ['command' => $command, 'table' => $input->getArgument('table')]; |
|
| 45 | 45 | |
| 46 | 46 | if ($command == 'make:model') { |
| 47 | 47 | $arguments['--type'] = $input->getOption('type'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | self::prepareDependencies(); |
| 43 | 43 | self::prepareTemplates(); |
| 44 | 44 | |
| 45 | - self::$application->setCommandPath(__DIR__ . DIRECTORY_SEPARATOR . 'Commands'); |
|
| 45 | + self::$application->setCommandPath(__DIR__.DIRECTORY_SEPARATOR.'Commands'); |
|
| 46 | 46 | self::$application->setCommandNamespace('Rougin\Combustor\Commands'); |
| 47 | 47 | |
| 48 | 48 | return self::$application; |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $basePath = BASEPATH; |
| 59 | 59 | |
| 60 | - require APPPATH . 'config/database.php'; |
|
| 60 | + require APPPATH.'config/database.php'; |
|
| 61 | 61 | |
| 62 | 62 | if (is_dir('vendor/rougin/codeigniter/src/')) { |
| 63 | 63 | $basePath = 'vendor/rougin/codeigniter/src/'; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - require $basePath . 'helpers/inflector_helper.php'; |
|
| 66 | + require $basePath.'helpers/inflector_helper.php'; |
|
| 67 | 67 | |
| 68 | 68 | $driver = new \Rougin\Describe\Driver\CodeIgniterDriver($db[$active_group]); |
| 69 | 69 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected static function prepareTemplates() |
| 79 | 79 | { |
| 80 | - $extensions = [ new \Rougin\Combustor\Common\InflectorExtension ]; |
|
| 80 | + $extensions = [new \Rougin\Combustor\Common\InflectorExtension]; |
|
| 81 | 81 | |
| 82 | 82 | $template = self::$application->getTemplatePath(); |
| 83 | 83 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $filename = ucfirst(plural(underscore($input->getArgument('table')))); |
| 41 | 41 | $rendered = $this->renderer->render('Controller.twig', $contents); |
| 42 | 42 | |
| 43 | - $this->filesystem->write('application/controllers/' . $filename . '.php', $rendered); |
|
| 43 | + $this->filesystem->write('application/controllers/'.$filename.'.php', $rendered); |
|
| 44 | 44 | |
| 45 | 45 | $output->writeln('<info>Controller created successfully!</info>'); |
| 46 | 46 | } |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | public function getFilters() |
| 19 | 19 | { |
| 20 | 20 | return [ |
| 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 | |