@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:flush"); |
| 22 | 21 | $this->setDescription("Flushes cache storage used by cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Flushing cache storage</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:clean"); |
| 22 | 21 | $this->setDescription("Cleans cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Cleaning all cache types</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | protected $_config; |
| 16 | 16 | protected $_projectPath; |
| 17 | 17 | |
| 18 | - protected function configure() |
|
| 19 | - { |
|
| 18 | + protected function configure() { |
|
| 20 | 19 | $this->_projectPath = getcwd(); |
| 21 | 20 | $this->setName("cache:disable"); |
| 22 | 21 | $this->setDescription("Disable cache types"); |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | * @return ProcessCommand |
| 30 | 29 | */ |
| 31 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 32 | - { |
|
| 30 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 33 | 31 | $output->writeln('<info>Disabling all cache types</info>'); |
| 34 | 32 | |
| 35 | 33 | $cacheType = $input->getArgument('type'); |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param Config $config |
| 43 | 41 | * @return bool|string |
| 44 | 42 | */ |
| 45 | - protected function getCommand(Config $config, $cacheType) |
|
| 46 | - { |
|
| 43 | + protected function getCommand(Config $config, $cacheType) { |
|
| 47 | 44 | $type = $config->type; |
| 48 | 45 | switch ($type) { |
| 49 | 46 | case 'magento': |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * Configure the command and description |
| 18 | 18 | */ |
| 19 | - public function configure() |
|
| 20 | - { |
|
| 19 | + public function configure() { |
|
| 21 | 20 | $this->projectPath = getcwd(); |
| 22 | 21 | |
| 23 | 22 | $this->setName("self-update"); |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * @param OutputInterface $output |
| 32 | 31 | * @return ProcessCommand |
| 33 | 32 | */ |
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 33 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 36 | 34 | $output->writeln('<info>Checking for Updates</info>'); |
| 37 | 35 | return new ProcessCommand('composer global update richdynamix/magestead', $this->projectPath, $output); |
| 38 | 36 | } |
@@ -4,4 +4,6 @@ |
||
| 4 | 4 | * Class MissingComposerHomeException |
| 5 | 5 | * @package Magestead\Exceptions |
| 6 | 6 | */ |
| 7 | -class MissingComposerHomeException extends \Exception {} |
|
| 8 | 7 | \ No newline at end of file |
| 8 | +class MissingComposerHomeException extends \Exception |
|
| 9 | +{ |
|
| 10 | +} |
|
| 9 | 11 | \ No newline at end of file |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * @param array $auth |
| 13 | 13 | * @return self |
| 14 | 14 | */ |
| 15 | - public function setAuthObject(array $auth) |
|
| 16 | - { |
|
| 15 | + public function setAuthObject(array $auth) { |
|
| 17 | 16 | $this->message = sprintf(static::TPL, json_encode($auth, JSON_PRETTY_PRINT)); |
| 18 | 17 | return $this; |
| 19 | 18 | } |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | * Config constructor. |
| 22 | 22 | * @param OutputInterface $output |
| 23 | 23 | */ |
| 24 | - public function __construct(OutputInterface $output) |
|
| 25 | - { |
|
| 24 | + public function __construct(OutputInterface $output) { |
|
| 26 | 25 | $this->_projectPath = getcwd(); |
| 27 | 26 | $this->output = $output; |
| 28 | 27 | } |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * @param $name |
| 32 | 31 | * @return mixed |
| 33 | 32 | */ |
| 34 | - function __get($name) |
|
| 35 | - { |
|
| 33 | + function __get($name) { |
|
| 36 | 34 | $this->_config = $this->getConfigFile($this->output); |
| 37 | 35 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
| 38 | 36 | } |
@@ -41,8 +39,7 @@ discard block |
||
| 41 | 39 | * @param OutputInterface $output |
| 42 | 40 | * @return bool|mixed |
| 43 | 41 | */ |
| 44 | - protected function getConfigFile(OutputInterface $output) |
|
| 45 | - { |
|
| 42 | + protected function getConfigFile(OutputInterface $output) { |
|
| 46 | 43 | $config = new Parser(); |
| 47 | 44 | try { |
| 48 | 45 | return $config->parse($this->readConfigFile()); |
@@ -57,8 +54,7 @@ discard block |
||
| 57 | 54 | * @return string |
| 58 | 55 | * @throws MissingConfigFileException |
| 59 | 56 | */ |
| 60 | - protected function readConfigFile() |
|
| 61 | - { |
|
| 57 | + protected function readConfigFile() { |
|
| 62 | 58 | if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
| 63 | 59 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
| 64 | 60 | } |
@@ -72,8 +68,7 @@ discard block |
||
| 72 | 68 | * @return string |
| 73 | 69 | * @throws MissingComposerHomeException |
| 74 | 70 | */ |
| 75 | - public function getComposerHomeDir() |
|
| 76 | - { |
|
| 71 | + public function getComposerHomeDir() { |
|
| 77 | 72 | $composerConfig = shell_exec('composer config --list --global | grep "\[home\]"'); |
| 78 | 73 | $composerConfig = array_filter(explode(PHP_EOL, $composerConfig)); |
| 79 | 74 | |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | * @param OutputInterface $output |
| 39 | 39 | * @param $project |
| 40 | 40 | */ |
| 41 | - public function __construct($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 42 | - { |
|
| 41 | + public function __construct($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 43 | 42 | $this->setVagrantSettings($helper, $input, $output); |
| 44 | 43 | |
| 45 | 44 | $this->setServerConfig($helper, $input, $output); |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | /** |
| 55 | 54 | * @return array |
| 56 | 55 | */ |
| 57 | - public function getAllOptions() |
|
| 58 | - { |
|
| 56 | + public function getAllOptions() { |
|
| 59 | 57 | return [ |
| 60 | 58 | 'app' => $this->_app, |
| 61 | 59 | 'server' => $this->_server, |
@@ -80,8 +78,7 @@ discard block |
||
| 80 | 78 | * @param InputInterface $input |
| 81 | 79 | * @param OutputInterface $output |
| 82 | 80 | */ |
| 83 | - protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 84 | - { |
|
| 81 | + protected function setVagrantSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 85 | 82 | $output->writeln('<comment>Lets configure your project\'s VM</comment>'); |
| 86 | 83 | |
| 87 | 84 | $ipQuestion = new Question("Configure the IP for your VM (192.168.47.47): ", '192.168.47.47'); |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | * @param OutputInterface $output |
| 101 | 98 | * @param $project |
| 102 | 99 | */ |
| 103 | - protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) |
|
| 104 | - { |
|
| 100 | + protected function setApplicationSettings($helper, InputInterface $input, OutputInterface $output, $project) { |
|
| 105 | 101 | $output->writeln('<comment>Lets configure your project\'s application</comment>'); |
| 106 | 102 | $appQuestion = new ChoiceQuestion( |
| 107 | 103 | "Which application do you want to install?", |
@@ -127,8 +123,7 @@ discard block |
||
| 127 | 123 | * @param OutputInterface $output |
| 128 | 124 | * @return boolean|integer |
| 129 | 125 | */ |
| 130 | - protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) |
|
| 131 | - { |
|
| 126 | + protected function setMagento2Settings($helper, InputInterface $input, OutputInterface $output) { |
|
| 132 | 127 | if ($this->_app === 'magento2') { |
| 133 | 128 | $this->installSampleData($helper, $input, $output); |
| 134 | 129 | return $this->verifyAuth($helper, $input, $output); |
@@ -142,8 +137,7 @@ discard block |
||
| 142 | 137 | * @param InputInterface $input |
| 143 | 138 | * @param OutputInterface $output |
| 144 | 139 | */ |
| 145 | - protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) |
|
| 146 | - { |
|
| 140 | + protected function setVersionControlSettings($helper, InputInterface $input, OutputInterface $output) { |
|
| 147 | 141 | $versionControl = new ConfirmationQuestion("Would you like to add your project to GIT? (no/yes) ", false); |
| 148 | 142 | $versioning = $helper->ask($input, $output, $versionControl); |
| 149 | 143 | if ($versioning) { |
@@ -152,8 +146,7 @@ discard block |
||
| 152 | 146 | } |
| 153 | 147 | } |
| 154 | 148 | |
| 155 | - protected function installSampleData($helper, InputInterface $input, OutputInterface $output) |
|
| 156 | - { |
|
| 149 | + protected function installSampleData($helper, InputInterface $input, OutputInterface $output) { |
|
| 157 | 150 | $sampleInstall = new ConfirmationQuestion("Would you like to install sample data? (no/yes) ", false); |
| 158 | 151 | $this->installSampleData = $helper->ask($input, $output, $sampleInstall); |
| 159 | 152 | } |
@@ -163,8 +156,7 @@ discard block |
||
| 163 | 156 | * @param InputInterface $input |
| 164 | 157 | * @param OutputInterface $output |
| 165 | 158 | */ |
| 166 | - protected function askForAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 167 | - { |
|
| 159 | + protected function askForAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 168 | 160 | $username = new Question("Please enter your Magento username (public key): ", ''); |
| 169 | 161 | $this->_m2Username = $helper->ask($input, $output, $username); |
| 170 | 162 | |
@@ -178,8 +170,7 @@ discard block |
||
| 178 | 170 | * @param OutputInterface $output |
| 179 | 171 | * @return boolean|integer |
| 180 | 172 | */ |
| 181 | - protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) |
|
| 182 | - { |
|
| 173 | + protected function verifyAuth($helper, InputInterface $input, OutputInterface $output) { |
|
| 183 | 174 | $composerHome = (new Config($output))->getComposerHomeDir(); |
| 184 | 175 | $authFile = $composerHome . "/auth.json"; |
| 185 | 176 | |
@@ -214,8 +205,7 @@ discard block |
||
| 214 | 205 | * @param InputInterface $input |
| 215 | 206 | * @param OutputInterface $output |
| 216 | 207 | */ |
| 217 | - protected function setPhp($helper, InputInterface $input, OutputInterface $output) |
|
| 218 | - { |
|
| 208 | + protected function setPhp($helper, InputInterface $input, OutputInterface $output) { |
|
| 219 | 209 | $phpVerQuestion = new ChoiceQuestion( |
| 220 | 210 | "Which version of PHP should be installed?", |
| 221 | 211 | ['56', '70'], |
@@ -228,8 +218,7 @@ discard block |
||
| 228 | 218 | /** |
| 229 | 219 | * Set box name from concat user options |
| 230 | 220 | */ |
| 231 | - protected function setVagrantBox() |
|
| 232 | - { |
|
| 221 | + protected function setVagrantBox() { |
|
| 233 | 222 | $this->_box = self::BOX_PREFIX . $this->_os . "-$this->_server-php$this->_phpVer"; |
| 234 | 223 | } |
| 235 | 224 | |
@@ -238,8 +227,7 @@ discard block |
||
| 238 | 227 | * @param InputInterface $input |
| 239 | 228 | * @param OutputInterface $output |
| 240 | 229 | */ |
| 241 | - protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) |
|
| 242 | - { |
|
| 230 | + protected function setServerConfig($helper, InputInterface $input, OutputInterface $output) { |
|
| 243 | 231 | $output->writeln('<comment>Lets configure your server</comment>'); |
| 244 | 232 | $this->setOperatingSystem($helper, $input, $output); |
| 245 | 233 | $this->setWebServer($helper, $input, $output); |
@@ -251,8 +239,7 @@ discard block |
||
| 251 | 239 | * @param InputInterface $input |
| 252 | 240 | * @param OutputInterface $output |
| 253 | 241 | */ |
| 254 | - protected function setWebServer($helper, InputInterface $input, OutputInterface $output) |
|
| 255 | - { |
|
| 242 | + protected function setWebServer($helper, InputInterface $input, OutputInterface $output) { |
|
| 256 | 243 | $serverQuestion = new ChoiceQuestion( |
| 257 | 244 | "Which webserver would you like?", |
| 258 | 245 | ['NGINX', 'Apache'], |
@@ -267,8 +254,7 @@ discard block |
||
| 267 | 254 | * @param InputInterface $input |
| 268 | 255 | * @param OutputInterface $output |
| 269 | 256 | */ |
| 270 | - protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) |
|
| 271 | - { |
|
| 257 | + protected function setOperatingSystem($helper, InputInterface $input, OutputInterface $output) { |
|
| 272 | 258 | $osQuestion = new ChoiceQuestion( |
| 273 | 259 | "Which OS would you like to install?", |
| 274 | 260 | ['CentOS 6.5', 'Ubuntu 14'], |
@@ -14,8 +14,7 @@ |
||
| 14 | 14 | * |
| 15 | 15 | * @param $message |
| 16 | 16 | */ |
| 17 | - public static function send($message) |
|
| 18 | - { |
|
| 17 | + public static function send($message) { |
|
| 19 | 18 | $notifier = NotifierFactory::create(); |
| 20 | 19 | $basePath = dirname( __FILE__ ) . '/../../../'; |
| 21 | 20 | $notification = |