@@ -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 | } |
@@ -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'] = [ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $data['plural'] = plural($data['name']); |
| 45 | 45 | $data['singular'] = singular($data['name']); |
| 46 | 46 | |
| 47 | - $primaryKey = 'get_' . $this->describe->getPrimaryKey($data['name']); |
|
| 47 | + $primaryKey = 'get_'.$this->describe->getPrimaryKey($data['name']); |
|
| 48 | 48 | $data['primaryKey'] = $primaryKey; |
| 49 | 49 | |
| 50 | 50 | if ($this->data['isCamel']) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $this->data['foreignKeys'][$field] = plural($referencedTable); |
| 87 | 87 | |
| 88 | - $singular = $field . '_singular'; |
|
| 88 | + $singular = $field.'_singular'; |
|
| 89 | 89 | |
| 90 | 90 | $this->data['foreignKeys'][$singular] = singular( |
| 91 | 91 | $referencedTable |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getPrimaryKey(array $data, $field, $referencedTable) |
| 44 | 44 | { |
| 45 | - $accessor = 'get_' . $this->describe->getPrimaryKey($referencedTable); |
|
| 45 | + $accessor = 'get_'.$this->describe->getPrimaryKey($referencedTable); |
|
| 46 | 46 | |
| 47 | 47 | $data['primaryKeys'][$field] = $accessor; |
| 48 | 48 | |
@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | if ($type == 'camelize') { |
| 68 | 68 | return [ |
| 69 | 69 | 'field' => lcfirst(camelize($field)), |
| 70 | - 'accessor' => lcfirst(camelize('get_' . $field)), |
|
| 71 | - 'mutator' => lcfirst(camelize('set_' . $field)) |
|
| 70 | + 'accessor' => lcfirst(camelize('get_'.$field)), |
|
| 71 | + 'mutator' => lcfirst(camelize('set_'.$field)) |
|
| 72 | 72 | ]; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | return [ |
| 76 | 76 | 'field' => lcfirst(underscore($field)), |
| 77 | - 'accessor' => lcfirst(underscore('get_' . $field)), |
|
| 78 | - 'mutator' => lcfirst(underscore('set_' . $field)) |
|
| 77 | + 'accessor' => lcfirst(underscore('get_'.$field)), |
|
| 78 | + 'mutator' => lcfirst(underscore('set_'.$field)) |
|
| 79 | 79 | ]; |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->addLibrary('wildfire'); |
| 37 | 37 | |
| 38 | 38 | $template = $this->renderer->render('Libraries/Wildfire.template'); |
| 39 | - $wildfire = new File(APPPATH . 'libraries/Wildfire.php'); |
|
| 39 | + $wildfire = new File(APPPATH.'libraries/Wildfire.php'); |
|
| 40 | 40 | |
| 41 | 41 | $wildfire->putContents($template); |
| 42 | 42 | $wildfire->close(); |
@@ -45,6 +45,6 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $message = 'Wildfire is now installed successfully!'; |
| 47 | 47 | |
| 48 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 48 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 49 | 49 | } |
| 50 | 50 | } |
@@ -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,12 +106,12 @@ 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 | - $create = new File($filePath . '/create.php'); |
|
| 112 | - $edit = new File($filePath . '/edit.php'); |
|
| 113 | - $index = new File($filePath . '/index.php'); |
|
| 114 | - $show = new File($filePath . '/show.php'); |
|
| 111 | + $create = new File($filePath.'/create.php'); |
|
| 112 | + $edit = new File($filePath.'/edit.php'); |
|
| 113 | + $index = new File($filePath.'/index.php'); |
|
| 114 | + $show = new File($filePath.'/show.php'); |
|
| 115 | 115 | |
| 116 | 116 | $create->putContents($results['create']); |
| 117 | 117 | $edit->putContents($results['edit']); |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | $index->close(); |
| 124 | 124 | $show->close(); |
| 125 | 125 | |
| 126 | - $message = 'The views folder "' . $name . '" has been created successfully!'; |
|
| 126 | + $message = 'The views folder "'.$name.'" has been created successfully!'; |
|
| 127 | 127 | |
| 128 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 128 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 129 | 129 | } |
| 130 | 130 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function __construct($config, $configPath) |
| 35 | 35 | { |
| 36 | 36 | $this->config = $config; |
| 37 | - $this->fileName = $configPath . '/' . $config . '.php'; |
|
| 37 | + $this->fileName = $configPath.'/'.$config.'.php'; |
|
| 38 | 38 | |
| 39 | 39 | $content = file_get_contents($this->fileName); |
| 40 | 40 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | break; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $pattern = '/\$' . $this->config . '\[\'' . $item . '\'\] = ' . $value . ';/'; |
|
| 72 | + $pattern = '/\$'.$this->config.'\[\''.$item.'\'\] = '.$value.';/'; |
|
| 73 | 73 | |
| 74 | 74 | preg_match_all($pattern, $this->lines[$line], $match); |
| 75 | 75 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $result = array_filter($match[1]); |
| 79 | 79 | $data = ''; |
| 80 | 80 | |
| 81 | - if (! empty($result[0])) { |
|
| 81 | + if ( ! empty($result[0])) { |
|
| 82 | 82 | $data = $result[0]; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | switch ($dataType) { |
| 128 | 128 | case 'array': |
| 129 | 129 | for ($i = 0; $i < count($value); $i++) { |
| 130 | - $value[$i] = '\'' . $value[$i] . '\''; |
|
| 130 | + $value[$i] = '\''.$value[$i].'\''; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $data = 'array(' . implode(', ', $value) . ')'; |
|
| 133 | + $data = 'array('.implode(', ', $value).')'; |
|
| 134 | 134 | $format = 'array\([^)]*\)'; |
| 135 | 135 | |
| 136 | 136 | break; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | break; |
| 142 | 142 | case 'string': |
| 143 | - $data = '\'' . $value . '\''; |
|
| 143 | + $data = '\''.$value.'\''; |
|
| 144 | 144 | $format = '(.*?)'; |
| 145 | 145 | |
| 146 | 146 | break; |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | $data = $value; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $pattern = '/\$' . $this->config . '\[\'' . $item . '\'\] = ' . $format . ';/'; |
|
| 154 | - $replacement = '$' . $this->config . '[\'' . $item . '\'] = ' . $data . ';'; |
|
| 153 | + $pattern = '/\$'.$this->config.'\[\''.$item.'\'\] = '.$format.';/'; |
|
| 154 | + $replacement = '$'.$this->config.'[\''.$item.'\'] = '.$data.';'; |
|
| 155 | 155 | |
| 156 | 156 | $result = preg_replace($pattern, $replacement, $this->lines[$line]); |
| 157 | 157 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function isEnabled() |
| 36 | 36 | { |
| 37 | - $file = APPPATH . 'libraries/' . $this->library . '.php'; |
|
| 37 | + $file = APPPATH.'libraries/'.$this->library.'.php'; |
|
| 38 | 38 | |
| 39 | 39 | return file_exists($file); |
| 40 | 40 | } |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | protected function configure() |
| 48 | 48 | { |
| 49 | 49 | $this |
| 50 | - ->setName('remove:' . $this->library) |
|
| 51 | - ->setDescription('Removes ' . ucfirst($this->library)); |
|
| 50 | + ->setName('remove:'.$this->library) |
|
| 51 | + ->setDescription('Removes '.ucfirst($this->library)); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function execute(InputInterface $input, OutputInterface $output) |
| 62 | 62 | { |
| 63 | - $autoload = new Config('autoload', APPPATH . 'config'); |
|
| 63 | + $autoload = new Config('autoload', APPPATH.'config'); |
|
| 64 | 64 | |
| 65 | 65 | $libraries = $autoload->get('libraries', 60, 'array'); |
| 66 | 66 | |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | system('composer remove doctrine/orm'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - unlink(APPPATH . 'libraries/' . ucfirst($this->library) . '.php'); |
|
| 80 | + unlink(APPPATH.'libraries/'.ucfirst($this->library).'.php'); |
|
| 81 | 81 | |
| 82 | - $message = ucfirst($this->library) . ' is now successfully removed!'; |
|
| 82 | + $message = ucfirst($this->library).' is now successfully removed!'; |
|
| 83 | 83 | |
| 84 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 84 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 85 | 85 | } |
| 86 | 86 | } |