@@ -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; |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | protected static function shouldThemeBeInstalled($config, QuestionHelper $helper, InputInterface $input, OutputInterface $output) |
46 | 46 | { |
47 | 47 | $question = new Question("<info>Install default theme Y/n</info>: ", 'Y'); |
48 | - $response = strtolower( trim( $helper->ask( $input, $output, $question) ) ); |
|
49 | - $shouldInstall = ( 0 === strpos( $response, 'y' ) || '' === $response ); |
|
48 | + $response = strtolower(trim($helper->ask($input, $output, $question))); |
|
49 | + $shouldInstall = (0 === strpos($response, 'y') || '' === $response); |
|
50 | 50 | |
51 | 51 | // Remove theme details if the theme is not going to be installed. |
52 | - if ( ! $shouldInstall && isset( $config['theme'] ) ) { |
|
53 | - unset( $config['theme'] ); |
|
52 | + if (!$shouldInstall && isset($config['theme'])) { |
|
53 | + unset($config['theme']); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Remove post install theme commands if the theme is not going to be installed. |
57 | - if ( ! $shouldInstall && isset( $config['commands']['postInstallTheme'] ) ) { |
|
58 | - unset( $config['commands']['postInstallTheme'] ); |
|
57 | + if (!$shouldInstall && isset($config['commands']['postInstallTheme'])) { |
|
58 | + unset($config['commands']['postInstallTheme']); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | return $config; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | // For now all validation is 2 levels deep so this should be good for now. |
74 | 74 | $keys = explode(':', $ruleKey); |
75 | - $config[ $keys[0] ][ $keys[1] ] = $value; |
|
75 | + $config[$keys[0]][$keys[1]] = $value; |
|
76 | 76 | |
77 | 77 | return $config; |
78 | 78 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // Ask the question. |
102 | 102 | $questionValue = $value ? " (<info>{$value}</info>)" : ''; |
103 | 103 | $question = new Question("{$message}{$questionValue}: ", $value); |
104 | - $question->setValidator(function ($answer) use ($message) { |
|
104 | + $question->setValidator(function($answer) use ($message) { |
|
105 | 105 | if (!$answer) { |
106 | 106 | throw new RuntimeException("{$message} is required!"); |
107 | 107 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | protected static function getValue($config, $ruleKey) |
124 | 124 | { |
125 | 125 | foreach (explode(':', $ruleKey) as $configKey) { |
126 | - $config = isset($config[ $configKey ]) ? $config[ $configKey ] : ''; |
|
126 | + $config = isset($config[$configKey]) ? $config[$configKey] : ''; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if (is_array($config)) { |
@@ -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); |
@@ -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 | /** |
@@ -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 | /** |
@@ -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 | } |
@@ -69,13 +69,13 @@ |
||
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'] = ''; |
76 | 76 | } |
77 | 77 | |
78 | - if (! is_null($version) && $version) { |
|
78 | + if (!is_null($version) && $version) { |
|
79 | 79 | $options['version'] = $version; |
80 | 80 | } |
81 | 81 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $themeName = isset($config['theme']['name']) ? $config['theme']['name'] : ''; |
27 | 27 | $commands = isset($config['commands']['postInstallTheme']) ? $config['commands']['postInstallTheme'] : []; |
28 | - if ( ! $themeName || ! $commands ) { |
|
28 | + if (!$themeName || !$commands) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 |