Conditions | 2 |
Paths | 2 |
Total Lines | 74 |
Code Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
20 | protected function execute(InputInterface $input, OutputInterface $output) |
||
21 | { |
||
22 | // Make sure the configuration exists. |
||
23 | if (!Configuration::exists()) { |
||
24 | throw new ConfigurationNotFound; |
||
25 | } |
||
26 | |||
27 | $output->writeln("<info>== Running Pre-install Commands =======================</info>"); |
||
28 | |||
29 | // Run pre-install commands. |
||
30 | PreInstall::executeCommands(); |
||
31 | |||
32 | $output->writeln("\n<info>== Installing WordPress =======================</info>"); |
||
33 | |||
34 | // Check/Download WordPress |
||
35 | WP::coreDownload(); |
||
36 | |||
37 | // Check/Create wp-config.php |
||
38 | WP::coreConfig(); |
||
39 | |||
40 | // Check/Create database |
||
41 | WP::dbCreate(); |
||
42 | |||
43 | // Check/Run install |
||
44 | WP::coreInstall(); |
||
45 | |||
46 | $output->writeln("\n<info>== Setting up Theme =======================</info>"); |
||
47 | |||
48 | // Delete default themes (Except latest) |
||
49 | WP::themeDeleteDefaults(); |
||
50 | $output->writeln(''); |
||
51 | |||
52 | // Check/Download/Merge theme (Zip/Tar/Git/Other?) |
||
53 | WP::themeInstall($output); |
||
54 | |||
55 | $output->writeln("\n<info>== Running Post Theme Install Commands =======================</info>"); |
||
56 | |||
57 | // Run post install theme commands. |
||
58 | PostInstall::executeThemeCommands(); |
||
59 | |||
60 | $output->writeln("\n<info>== Setting up plugins =======================</info>"); |
||
61 | |||
62 | // Remove default plugins |
||
63 | WP::pluginDeleteDefaults(); |
||
64 | $output->writeln(''); |
||
65 | |||
66 | // Install wp.org plugins |
||
67 | WP::pluginInstallAll($output); |
||
68 | |||
69 | $output->writeln("\n<info>== Cleaning up default posts =======================</info>"); |
||
70 | |||
71 | // Remove default posts |
||
72 | WP::postDeleteDefault(); |
||
73 | |||
74 | $output->writeln("\n<info>== Setting up menus =======================</info>"); |
||
75 | |||
76 | // Create menus from theme menu locations? |
||
77 | WP::menuCreateAll(); |
||
78 | |||
79 | $output->writeln("\n<info>== Setting Permalink Structure =======================</info>"); |
||
80 | |||
81 | // Set rewrite rules |
||
82 | WP::rewriteSetStructure(); |
||
83 | |||
84 | $output->writeln("\n<info>== Running Post Install Commands =======================</info>"); |
||
85 | |||
86 | // Run post install commands. |
||
87 | PostInstall::executeCommands(); |
||
88 | |||
89 | $output->writeln("\n<info>Install Completed!</info>"); |
||
90 | |||
91 | // Clean up the configuration for VCS. |
||
92 | Configuration::cleanUpConfigForVCS(); |
||
93 | } |
||
94 | } |
||
95 |