@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | try { |
| 62 | 62 | $this->executeCommand($input, $output); |
| 63 | 63 | } catch (BoilerException $exception) { |
| 64 | - $output->write('<error>' . $exception->getMessage() . '</error>'); |
|
| 64 | + $output->write('<error>'.$exception->getMessage().'</error>'); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | protected function executeScripts(OutputInterface $output, array $template): void |
| 91 | 91 | { |
| 92 | 92 | foreach ($template['steps'] as $step) { |
| 93 | - $output->writeln('<info>Executing ' . $template[$step]['name'] . '</info>'); |
|
| 93 | + $output->writeln('<info>Executing '.$template[$step]['name'].'</info>'); |
|
| 94 | 94 | $scripts = is_array($template[$step]['script']) ? $template[$step]['script'] : [$template[$step]['script']]; |
| 95 | 95 | foreach ($scripts as $script) { |
| 96 | 96 | exec($this->replaceVariables($script)); |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $this->paths = $this->configuration->getPaths(); |
| 112 | 112 | |
| 113 | - if (empty($this->paths)) { |
|
| 113 | + if (empty( $this->paths )) { |
|
| 114 | 114 | throw new BoilerException('No paths configured'); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $templateFileName = $input->getArgument('template'); |
| 118 | 118 | |
| 119 | - if (empty($templateFileName)) { |
|
| 119 | + if (empty( $templateFileName )) { |
|
| 120 | 120 | throw new BoilerException('No template given.'); |
| 121 | 121 | } elseif (is_array($templateFileName)) { |
| 122 | 122 | throw new BoilerException('Only one template is allowed.'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | throw new BoilerException('Folder already exists'); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - $output->writeln('<info>Installing ' . $templateName . '</info>'); |
|
| 134 | + $output->writeln('<info>Installing '.$templateName.'</info>'); |
|
| 135 | 135 | $this->variables['template_name'] = $templateName; |
| 136 | 136 | |
| 137 | 137 | mkdir($directoryName); |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $finder = new Finder(); |
| 153 | 153 | foreach ($this->paths as $directory) { |
| 154 | - $templateDir = $directory . '/' . $name; |
|
| 154 | + $templateDir = $directory.'/'.$name; |
|
| 155 | 155 | if (!is_dir($templateDir)) { |
| 156 | 156 | continue; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $finder->in($templateDir) |
| 160 | - ->notName($name . '.yml') |
|
| 160 | + ->notName($name.'.yml') |
|
| 161 | 161 | ->sortByType() |
| 162 | 162 | ->ignoreDotFiles(false); |
| 163 | 163 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | { |
| 35 | 35 | $paths = $this->configuration->getPaths(); |
| 36 | 36 | |
| 37 | - if (empty($paths)) { |
|
| 37 | + if (empty( $paths )) { |
|
| 38 | 38 | $output->writeln('<info>No paths set...</info>'); |
| 39 | 39 | |
| 40 | 40 | return; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $templateFile = $this->getTemplate($templateFileName); |
| 83 | 83 | |
| 84 | 84 | if (is_null($templateFile)) { |
| 85 | - throw new BoilerException('No template found with name ' . $templateFileName); |
|
| 85 | + throw new BoilerException('No template found with name '.$templateFileName); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $pathName = $templateFile->getPathname(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | protected function getTemplate(string $name): ?SplFileInfo |
| 106 | 106 | { |
| 107 | 107 | foreach ($this->paths as $directory) { |
| 108 | - $fileInDirectory = $this->findYamlFileInDirectory($name, $directory . '/' . $name); |
|
| 108 | + $fileInDirectory = $this->findYamlFileInDirectory($name, $directory.'/'.$name); |
|
| 109 | 109 | |
| 110 | 110 | if (!is_null($fileInDirectory)) { |
| 111 | 111 | return $fileInDirectory; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | return Yaml::parseFile($path); |
| 137 | 137 | } catch (ParseException $exception) { |
| 138 | 138 | throw new BoilerException( |
| 139 | - 'Template file located at `' . $path . '` could not be parsed', |
|
| 139 | + 'Template file located at `'.$path.'` could not be parsed', |
|
| 140 | 140 | $exception->getCode(), |
| 141 | 141 | $exception |
| 142 | 142 | ); |
@@ -191,12 +191,12 @@ discard block |
||
| 191 | 191 | return array_map(function ($fileName) { |
| 192 | 192 | $templateFile = $this->getTemplate($fileName); |
| 193 | 193 | if ($templateFile === null) { |
| 194 | - throw new BoilerException('Included file `' . $fileName . '` does not exists'); |
|
| 194 | + throw new BoilerException('Included file `'.$fileName.'` does not exists'); |
|
| 195 | 195 | } |
| 196 | 196 | $template = $this->parseTemplateFile($templateFile->getPathname()); |
| 197 | 197 | |
| 198 | 198 | if (!$template) { |
| 199 | - throw new BoilerException('Included file `' . $fileName . '` cannot be parsed'); |
|
| 199 | + throw new BoilerException('Included file `'.$fileName.'` cannot be parsed'); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | return $template; |
@@ -229,11 +229,11 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | protected function validateTemplate(array $template): void |
| 231 | 231 | { |
| 232 | - if (!array_key_exists('name', $template) || empty($template['name'])) { |
|
| 232 | + if (!array_key_exists('name', $template) || empty( $template['name'] )) { |
|
| 233 | 233 | throw new BoilerException('There\'s no name defined in the template'); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if (!array_key_exists('steps', $template) || !is_array($template['steps']) || empty($template['steps'])) { |
|
| 236 | + if (!array_key_exists('steps', $template) || !is_array($template['steps']) || empty( $template['steps'] )) { |
|
| 237 | 237 | throw new BoilerException('There are no steps defined in the template'); |
| 238 | 238 | } |
| 239 | 239 | |
@@ -252,15 +252,15 @@ discard block |
||
| 252 | 252 | $steps = $template['steps']; |
| 253 | 253 | foreach ($steps as $step) { |
| 254 | 254 | if (!array_key_exists($step, $template)) { |
| 255 | - throw new BoilerException('The step `' . $step . '` does not exists.'); |
|
| 255 | + throw new BoilerException('The step `'.$step.'` does not exists.'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | if (!array_key_exists('name', $template[$step])) { |
| 259 | - throw new BoilerException('No `name` set for the step `' . $step . '`'); |
|
| 259 | + throw new BoilerException('No `name` set for the step `'.$step.'`'); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | if (!array_key_exists('script', $template[$step])) { |
| 263 | - throw new BoilerException('No `script` set for the step `' . $step . '`'); |
|
| 263 | + throw new BoilerException('No `script` set for the step `'.$step.'`'); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |