@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param Config $config |
| 37 | - * @return bool|string |
|
| 37 | + * @return string|false |
|
| 38 | 38 | */ |
| 39 | 39 | protected function getCommand(Config $config) |
| 40 | 40 | { |
@@ -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"); |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * @param OutputInterface $output |
| 28 | 27 | * @return ProcessCommand |
| 29 | 28 | */ |
| 30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 31 | - { |
|
| 29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
| 33 | 31 | |
| 34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | * @param Config $config |
| 41 | 39 | * @return bool|string |
| 42 | 40 | */ |
| 43 | - protected function getCommand(Config $config) |
|
| 44 | - { |
|
| 41 | + protected function getCommand(Config $config) { |
|
| 45 | 42 | $type = $config->type; |
| 46 | 43 | switch ($type) { |
| 47 | 44 | case 'magento': |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param Config $config |
| 37 | - * @return bool|string |
|
| 37 | + * @return string|false |
|
| 38 | 38 | */ |
| 39 | 39 | protected function getCommand(Config $config) |
| 40 | 40 | { |
@@ -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"); |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * @param OutputInterface $output |
| 28 | 27 | * @return ProcessCommand |
| 29 | 28 | */ |
| 30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 31 | - { |
|
| 29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
| 33 | 31 | |
| 34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | * @param Config $config |
| 41 | 39 | * @return bool|string |
| 42 | 40 | */ |
| 43 | - protected function getCommand(Config $config) |
|
| 44 | - { |
|
| 41 | + protected function getCommand(Config $config) { |
|
| 45 | 42 | $type = $config->type; |
| 46 | 43 | switch ($type) { |
| 47 | 44 | case 'magento': |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param Config $config |
| 37 | - * @return bool|string |
|
| 37 | + * @return string|false |
|
| 38 | 38 | */ |
| 39 | 39 | protected function getCommand(Config $config) |
| 40 | 40 | { |
@@ -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"); |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * @param OutputInterface $output |
| 28 | 27 | * @return ProcessCommand |
| 29 | 28 | */ |
| 30 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 31 | - { |
|
| 29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 32 | 30 | $output->writeln('<info>Disabling all cache types</info>'); |
| 33 | 31 | |
| 34 | 32 | $command = $this->getCommand(new Config($output)); |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | * @param Config $config |
| 41 | 39 | * @return bool|string |
| 42 | 40 | */ |
| 43 | - protected function getCommand(Config $config) |
|
| 44 | - { |
|
| 41 | + protected function getCommand(Config $config) { |
|
| 45 | 42 | $type = $config->type; |
| 46 | 43 | switch ($type) { |
| 47 | 44 | case 'magento': |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * @param array $options |
| 11 | 11 | * @param array $config |
| 12 | - * @param $projectPath |
|
| 13 | - * @param $output |
|
| 12 | + * @param string $projectPath |
|
| 13 | + * @param \Symfony\Component\Console\Output\OutputInterface $output |
|
| 14 | 14 | * @return Magento2Project|MagentoProject |
| 15 | 15 | */ |
| 16 | 16 | public static function create(array $options, array $config, $projectPath, $output) |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | * @param $output |
| 14 | 14 | * @return Magento2Project|MagentoProject |
| 15 | 15 | */ |
| 16 | - public static function create(array $options, array $config, $projectPath, $output) |
|
| 17 | - { |
|
| 16 | + public static function create(array $options, array $config, $projectPath, $output) { |
|
| 18 | 17 | switch ($options['app']) { |
| 19 | 18 | case "magento": |
| 20 | 19 | return new MagentoProject($options, $config, $projectPath, $output); |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * @param $projectPath |
| 16 | 16 | * @param OutputInterface $output |
| 17 | 17 | */ |
| 18 | - public function __construct($repoUrl, $projectPath, OutputInterface $output) |
|
| 19 | - { |
|
| 18 | + public function __construct($repoUrl, $projectPath, OutputInterface $output) { |
|
| 20 | 19 | $this->_repoUrl = $repoUrl; |
| 21 | 20 | $this->_projectPath = $projectPath; |
| 22 | 21 | $this->_output = $output; |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * @param OutputInterface $output |
| 29 | 28 | */ |
| 30 | - protected function execute(OutputInterface $output) |
|
| 31 | - { |
|
| 29 | + protected function execute(OutputInterface $output) { |
|
| 32 | 30 | $output->writeln('<info>Configuring GIT repo</info>'); |
| 33 | 31 | $this->init(); |
| 34 | 32 | |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | * |
| 48 | 46 | * @return $this |
| 49 | 47 | */ |
| 50 | - public function init() |
|
| 51 | - { |
|
| 48 | + public function init() { |
|
| 52 | 49 | $command = 'git init; git remote add origin ' . $this->_repoUrl; |
| 53 | 50 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 54 | 51 | |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | * |
| 61 | 58 | * @return $this |
| 62 | 59 | */ |
| 63 | - public function addFiles() |
|
| 64 | - { |
|
| 60 | + public function addFiles() { |
|
| 65 | 61 | $command = 'git add -A'; |
| 66 | 62 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 67 | 63 | |
@@ -73,8 +69,7 @@ discard block |
||
| 73 | 69 | * |
| 74 | 70 | * @return $this |
| 75 | 71 | */ |
| 76 | - public function commitFiles() |
|
| 77 | - { |
|
| 72 | + public function commitFiles() { |
|
| 78 | 73 | $command = "git commit -m 'Initial commit'"; |
| 79 | 74 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 80 | 75 | |
@@ -86,8 +81,7 @@ discard block |
||
| 86 | 81 | * |
| 87 | 82 | * @return $this |
| 88 | 83 | */ |
| 89 | - public function pushFiles() |
|
| 90 | - { |
|
| 84 | + public function pushFiles() { |
|
| 91 | 85 | $command = "git push -u origin master"; |
| 92 | 86 | new ProcessCommand($command, $this->_projectPath, $this->_output); |
| 93 | 87 | |
@@ -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 = |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | * @param array $options |
| 13 | 13 | * @param OutputInterface $output |
| 14 | 14 | */ |
| 15 | - public static function verify(array $options, OutputInterface $output) |
|
| 16 | - { |
|
| 15 | + public static function verify(array $options, OutputInterface $output) { |
|
| 17 | 16 | $hostPlugin = `vagrant plugin list | grep vagrant-hostsupdater`; |
| 18 | 17 | if (is_null($hostPlugin)) { |
| 19 | 18 | self::editHostsInstructions($options, $output); |
@@ -26,8 +25,7 @@ discard block |
||
| 26 | 25 | * @param array $options |
| 27 | 26 | * @param OutputInterface $output |
| 28 | 27 | */ |
| 29 | - protected static function editHostsInstructions(array $options, OutputInterface $output) |
|
| 30 | - { |
|
| 28 | + protected static function editHostsInstructions(array $options, OutputInterface $output) { |
|
| 31 | 29 | $output->writeln('<comment>NOTE: You will need to add the following to your hosts file!</comment>'); |
| 32 | 30 | $comment = $options['vagrantfile']['vm']['network']['private_network'] . |
| 33 | 31 | ' ' . $options['magestead']['apps']['mba_12345']['base_url']; |
@@ -13,8 +13,7 @@ discard block |
||
| 13 | 13 | * Config constructor. |
| 14 | 14 | * @param OutputInterface $output |
| 15 | 15 | */ |
| 16 | - public function __construct(OutputInterface $output) |
|
| 17 | - { |
|
| 16 | + public function __construct(OutputInterface $output) { |
|
| 18 | 17 | $this->_projectPath = getcwd(); |
| 19 | 18 | $this->_config = $this->getConfigFile($output); |
| 20 | 19 | } |
@@ -23,8 +22,7 @@ discard block |
||
| 23 | 22 | * @param $name |
| 24 | 23 | * @return mixed |
| 25 | 24 | */ |
| 26 | - function __get($name) |
|
| 27 | - { |
|
| 25 | + function __get($name) { |
|
| 28 | 26 | return $this->_config['magestead']['apps']['mba_12345'][$name]; |
| 29 | 27 | } |
| 30 | 28 | |
@@ -32,8 +30,7 @@ discard block |
||
| 32 | 30 | * @param OutputInterface $output |
| 33 | 31 | * @return bool|mixed |
| 34 | 32 | */ |
| 35 | - protected function getConfigFile(OutputInterface $output) |
|
| 36 | - { |
|
| 33 | + protected function getConfigFile(OutputInterface $output) { |
|
| 37 | 34 | $config = new Parser(); |
| 38 | 35 | try { |
| 39 | 36 | return $config->parse($this->readConfigFile()); |
@@ -48,8 +45,7 @@ discard block |
||
| 48 | 45 | * @return string |
| 49 | 46 | * @throws MissingConfigFileException |
| 50 | 47 | */ |
| 51 | - protected function readConfigFile() |
|
| 52 | - { |
|
| 48 | + protected function readConfigFile() { |
|
| 53 | 49 | if (!file_exists($this->_projectPath . '/magestead.yaml')) { |
| 54 | 50 | throw new MissingConfigFileException('No config file was found, are you in the project root?'); |
| 55 | 51 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @param $projectPath |
| 21 | 21 | * @param OutputInterface $output |
| 22 | 22 | */ |
| 23 | - public function __construct(array $options, array $config, $projectPath, OutputInterface $output) |
|
| 24 | - { |
|
| 23 | + public function __construct(array $options, array $config, $projectPath, OutputInterface $output) { |
|
| 25 | 24 | $this->composerInstall($projectPath, $output); |
| 26 | 25 | $this->installMagento($config, $projectPath, $output); |
| 27 | 26 | $this->finaliseSetup($options, $projectPath, $output); |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * @param $projectPath |
| 35 | 34 | * @param OutputInterface $output |
| 36 | 35 | */ |
| 37 | - protected function composerInstall($projectPath, OutputInterface $output) |
|
| 38 | - { |
|
| 36 | + protected function composerInstall($projectPath, OutputInterface $output) { |
|
| 39 | 37 | $output->writeln('<info>Installing Magento 2 with Composer</info>'); |
| 40 | 38 | $command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition public'; |
| 41 | 39 | new ProcessCommand($command, $projectPath, $output); |
@@ -49,8 +47,7 @@ discard block |
||
| 49 | 47 | * @param $projectPath |
| 50 | 48 | * @param OutputInterface $output |
| 51 | 49 | */ |
| 52 | - protected function addPhpSpecPackage($projectPath, OutputInterface $output) |
|
| 53 | - { |
|
| 50 | + protected function addPhpSpecPackage($projectPath, OutputInterface $output) { |
|
| 54 | 51 | $output->writeln('<comment>Installing PHPSpec</comment>'); |
| 55 | 52 | $command = 'cd '.$projectPath.'/public; composer require phpspec/phpspec --dev;'; |
| 56 | 53 | new ProcessCommand($command, $projectPath, $output); |
@@ -62,8 +59,7 @@ discard block |
||
| 62 | 59 | * @param $projectPath |
| 63 | 60 | * @param OutputInterface $output |
| 64 | 61 | */ |
| 65 | - protected function addBehatPackage($projectPath, OutputInterface $output) |
|
| 66 | - { |
|
| 62 | + protected function addBehatPackage($projectPath, OutputInterface $output) { |
|
| 67 | 63 | $output->writeln('<comment>Installing Behat</comment>'); |
| 68 | 64 | $command = 'cd '.$projectPath.'/public; composer require behat/behat --dev;'; |
| 69 | 65 | new ProcessCommand($command, $projectPath, $output); |
@@ -76,8 +72,7 @@ discard block |
||
| 76 | 72 | * @param $projectPath |
| 77 | 73 | * @param OutputInterface $output |
| 78 | 74 | */ |
| 79 | - protected function installMagento(array $options, $projectPath, OutputInterface $output) |
|
| 80 | - { |
|
| 75 | + protected function installMagento(array $options, $projectPath, OutputInterface $output) { |
|
| 81 | 76 | $this->setPermissions($projectPath, $output); |
| 82 | 77 | |
| 83 | 78 | $output->writeln('<info>Installing Magento 2 Software</info>'); |
@@ -110,8 +105,7 @@ discard block |
||
| 110 | 105 | * @param $projectPath |
| 111 | 106 | * @param OutputInterface $output |
| 112 | 107 | */ |
| 113 | - protected function setPermissions($projectPath, OutputInterface $output) |
|
| 114 | - { |
|
| 108 | + protected function setPermissions($projectPath, OutputInterface $output) { |
|
| 115 | 109 | $output->writeln('<info>Setting Permissions</info>'); |
| 116 | 110 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type d -exec chmod 700 {} \;\''; |
| 117 | 111 | new ProcessCommand($command, $projectPath, $output); |
@@ -130,8 +124,7 @@ discard block |
||
| 130 | 124 | * @param $projectPath |
| 131 | 125 | * @param OutputInterface $output |
| 132 | 126 | */ |
| 133 | - protected function configureRedis($projectPath, OutputInterface $output) |
|
| 134 | - { |
|
| 127 | + protected function configureRedis($projectPath, OutputInterface $output) { |
|
| 135 | 128 | $output->writeln('<comment>Configuring Redis Cache</comment>'); |
| 136 | 129 | $file = "$projectPath/public/app/etc/env.php"; |
| 137 | 130 | $env = include $file; |
@@ -183,8 +176,7 @@ discard block |
||
| 183 | 176 | * @param $projectPath |
| 184 | 177 | * @param OutputInterface $output |
| 185 | 178 | */ |
| 186 | - protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) |
|
| 187 | - { |
|
| 179 | + protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) { |
|
| 188 | 180 | $command = 'vagrant ssh -c \'cd /var/www/public; bin/magento indexer:reindex; \''; |
| 189 | 181 | $output->writeln('<comment>Reindexing Tables</comment>'); |
| 190 | 182 | new ProcessCommand($command, $projectPath, $output); |
@@ -201,8 +193,7 @@ discard block |
||
| 201 | 193 | * @param array $options |
| 202 | 194 | * @param OutputInterface $output |
| 203 | 195 | */ |
| 204 | - protected function showCredentials(array $options, OutputInterface $output) |
|
| 205 | - { |
|
| 196 | + protected function showCredentials(array $options, OutputInterface $output) { |
|
| 206 | 197 | $output->writeln('<info>SUCCESS: Magestead has finished installing Magento 2!</info>'); |
| 207 | 198 | $table = new Table($output); |
| 208 | 199 | $table |
@@ -221,8 +212,7 @@ discard block |
||
| 221 | 212 | * @param OutputInterface $output |
| 222 | 213 | * @return VersionControl |
| 223 | 214 | */ |
| 224 | - protected function processVcs(array $options, $projectPath, OutputInterface $output) |
|
| 225 | - { |
|
| 215 | + protected function processVcs(array $options, $projectPath, OutputInterface $output) { |
|
| 226 | 216 | if (!empty($options['repo_url'])) { |
| 227 | 217 | copy($projectPath . "/puphpet/magestead/magento2/stubs/gitignore.tmp", $projectPath . "/.gitignore"); |
| 228 | 218 | return new VersionControl($options['repo_url'], $projectPath, $output); |
@@ -232,8 +222,7 @@ discard block |
||
| 232 | 222 | /** |
| 233 | 223 | * @param $projectPath |
| 234 | 224 | */ |
| 235 | - protected function setComposerBinDir($projectPath) |
|
| 236 | - { |
|
| 225 | + protected function setComposerBinDir($projectPath) { |
|
| 237 | 226 | $file = "$projectPath/public/composer.json"; |
| 238 | 227 | $composer = json_decode(file_get_contents($file), true); |
| 239 | 228 | $composer['config']['bin-dir'] = 'bin'; |
@@ -244,8 +233,7 @@ discard block |
||
| 244 | 233 | * @param $projectPath |
| 245 | 234 | * @param OutputInterface $output |
| 246 | 235 | */ |
| 247 | - protected function setPhpSpecPermissions($projectPath, OutputInterface $output) |
|
| 248 | - { |
|
| 236 | + protected function setPhpSpecPermissions($projectPath, OutputInterface $output) { |
|
| 249 | 237 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/phpspec; bin/phpspec run\''; |
| 250 | 238 | new ProcessCommand($command, $projectPath, $output); |
| 251 | 239 | } |
@@ -254,8 +242,7 @@ discard block |
||
| 254 | 242 | * @param $projectPath |
| 255 | 243 | * @param OutputInterface $output |
| 256 | 244 | */ |
| 257 | - protected function setBehatPermissions($projectPath, OutputInterface $output) |
|
| 258 | - { |
|
| 245 | + protected function setBehatPermissions($projectPath, OutputInterface $output) { |
|
| 259 | 246 | $command = 'vagrant ssh -c \'cd /var/www/public; sudo chmod 755 bin/behat; bin/behat --init\''; |
| 260 | 247 | new ProcessCommand($command, $projectPath, $output); |
| 261 | 248 | } |