@@ -57,7 +57,8 @@ |
||
57 | 57 | /** |
58 | 58 | * Create project directory. |
59 | 59 | * |
60 | - * @return InitCommand |
|
60 | + * @param string $directory |
|
61 | + * @return ConfigureCommand |
|
61 | 62 | */ |
62 | 63 | protected function createProjectDirectory($directory, OutputInterface $output) |
63 | 64 | { |
@@ -18,14 +18,14 @@ |
||
18 | 18 | protected function configure() |
19 | 19 | { |
20 | 20 | $this->setName('configure') |
21 | - ->setDescription('Creates a new project directory and configuration.') |
|
22 | - ->addArgument('project-name', InputArgument::OPTIONAL, 'The project name.') |
|
23 | - ->addOption( |
|
24 | - 'global', |
|
25 | - null, |
|
26 | - InputOption::VALUE_NONE, |
|
27 | - 'Creates the global configuration if it does not already exist.' |
|
28 | - ); |
|
21 | + ->setDescription('Creates a new project directory and configuration.') |
|
22 | + ->addArgument('project-name', InputArgument::OPTIONAL, 'The project name.') |
|
23 | + ->addOption( |
|
24 | + 'global', |
|
25 | + null, |
|
26 | + InputOption::VALUE_NONE, |
|
27 | + 'Creates the global configuration if it does not already exist.' |
|
28 | + ); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -118,6 +118,7 @@ |
||
118 | 118 | /** |
119 | 119 | * Configuration skeleton |
120 | 120 | * |
121 | + * @param string $name |
|
121 | 122 | * @return string |
122 | 123 | */ |
123 | 124 | protected static function configSkeleton($name, InputInterface $input, OutputInterface $output, QuestionHelper $helper) |
@@ -157,7 +157,7 @@ |
||
157 | 157 | $plugins = []; |
158 | 158 | foreach ($config['plugins'] as $plugin) { |
159 | 159 | $key = $plugin['plugin']; |
160 | - $plugins[ $key ] = $plugin; |
|
160 | + $plugins[$key] = $plugin; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $config['plugins'] = array_values($plugins); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | public static function pluginInstall($plugin, $activate = true, $version = null) |
71 | 71 | { |
72 | - $options = [ 'force' => '' ]; |
|
72 | + $options = ['force' => '']; |
|
73 | 73 | |
74 | 74 | if ($activate) { |
75 | 75 | $options['activate'] = ''; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | protected static function execOptions($options) |
33 | 33 | { |
34 | - $options = array_map(function ($key, $value) { |
|
34 | + $options = array_map(function($key, $value) { |
|
35 | 35 | if ($value) { |
36 | 36 | return "--{$key}='{$value}'"; |
37 | 37 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $question = new Question("{$message}{$questionValue}: ", $value); |
73 | 73 | $question->setValidator(function ($answer) use ($message) { |
74 | 74 | if (!$answer) { |
75 | - throw new RuntimeException("{$message} is required!"); |
|
75 | + throw new RuntimeException("{$message} is required!"); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $answer; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | // For now all validation is 2 levels deep so this should be good for now. |
43 | 43 | $keys = explode(':', $ruleKey); |
44 | - $config[ $keys[0] ][ $keys[1] ] = $value; |
|
44 | + $config[$keys[0]][$keys[1]] = $value; |
|
45 | 45 | |
46 | 46 | return $config; |
47 | 47 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // Ask the question. |
71 | 71 | $questionValue = $value ? " (<info>{$value}</info>)" : ''; |
72 | 72 | $question = new Question("{$message}{$questionValue}: ", $value); |
73 | - $question->setValidator(function ($answer) use ($message) { |
|
73 | + $question->setValidator(function($answer) use ($message) { |
|
74 | 74 | if (!$answer) { |
75 | 75 | throw new RuntimeException("{$message} is required!"); |
76 | 76 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | $value = ''; |
95 | 95 | foreach (explode(':', $ruleKey) as $configKey) { |
96 | - $config = isset($config[ $configKey ]) ? $config[ $configKey ] : ''; |
|
96 | + $config = isset($config[$configKey]) ? $config[$configKey] : ''; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if (is_array($config)) { |
@@ -15,8 +15,8 @@ |
||
15 | 15 | protected function configure() |
16 | 16 | { |
17 | 17 | $this->setName('new') |
18 | - ->setDescription('Creates a new project directory, configuration and runs the install.') |
|
19 | - ->addArgument('project-name', InputArgument::REQUIRED, 'The project name.'); |
|
18 | + ->setDescription('Creates a new project directory, configuration and runs the install.') |
|
19 | + ->addArgument('project-name', InputArgument::REQUIRED, 'The project name.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -13,8 +13,8 @@ |
||
13 | 13 | { |
14 | 14 | protected function configure() |
15 | 15 | { |
16 | - $this->setName('install') |
|
17 | - ->setDescription('Installs WordPress, required plugins, theme and dependencies'); |
|
16 | + $this->setName('install') |
|
17 | + ->setDescription('Installs WordPress, required plugins, theme and dependencies'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -40,6 +40,6 @@ |
||
40 | 40 | */ |
41 | 41 | protected static function makeTempName($directory, $type) |
42 | 42 | { |
43 | - return $directory . '/' . md5(time().uniqid()) . ".{$type}"; |
|
43 | + return $directory . '/' . md5(time() . uniqid()) . ".{$type}"; |
|
44 | 44 | } |
45 | 45 | } |