| @@ -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 @@ | ||
| 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); | 
| @@ -24,8 +24,7 @@ discard block | ||
| 24 | 24 | * @param $projectPath | 
| 25 | 25 | * @param OutputInterface $output | 
| 26 | 26 | */ | 
| 27 | - public function __construct(array $options, array $config, $projectPath, OutputInterface $output) | |
| 28 | -    { | |
| 27 | +    public function __construct(array $options, array $config, $projectPath, OutputInterface $output) { | |
| 29 | 28 |          $output->writeln('<info>Installing Magento with Composer</info>'); | 
| 30 | 29 | $this->composerInstall($projectPath, $output); | 
| 31 | 30 | |
| @@ -46,8 +45,7 @@ discard block | ||
| 46 | 45 | * @param $projectPath | 
| 47 | 46 | * @param $output | 
| 48 | 47 | */ | 
| 49 | - protected function installMagento(array $options, $projectPath, OutputInterface $output) | |
| 50 | -    { | |
| 48 | +    protected function installMagento(array $options, $projectPath, OutputInterface $output) { | |
| 51 | 49 | $locale = $options['magestead']['apps']['mba_12345']['locale']; | 
| 52 | 50 | $db_name = $options['magestead']['apps']['mba_12345']['db_name']; | 
| 53 | 51 | $base_url = $options['magestead']['apps']['mba_12345']['base_url']; | 
| @@ -86,8 +84,7 @@ discard block | ||
| 86 | 84 | * @param $projectPath | 
| 87 | 85 | * @param OutputInterface $output | 
| 88 | 86 | */ | 
| 89 | - protected function setPermissions($projectPath, OutputInterface $output) | |
| 90 | -    { | |
| 87 | +    protected function setPermissions($projectPath, OutputInterface $output) { | |
| 91 | 88 |  //        $command = 'vagrant ssh -c \'cd /var/www/public; sudo find . -type f -exec chmod 400 {} \;\''; | 
| 92 | 89 |  //        $output->writeln('<comment>Setting Files Permissions</comment>'); | 
| 93 | 90 | // new ProcessCommand($command, $projectPath, $output); | 
| @@ -125,8 +122,7 @@ discard block | ||
| 125 | 122 | * @param $projectPath | 
| 126 | 123 | * @param OutputInterface $output | 
| 127 | 124 | */ | 
| 128 | - protected function installMagerun($projectPath, OutputInterface $output) | |
| 129 | -    { | |
| 125 | +    protected function installMagerun($projectPath, OutputInterface $output) { | |
| 130 | 126 | $command = 'vagrant ssh -c \'cd /var/www/bin; sudo wget https://files.magerun.net/n98-magerun.phar;\''; | 
| 131 | 127 |          $output->writeln('<info>Downloading Magerun</info>'); | 
| 132 | 128 | new ProcessCommand($command, $projectPath, $output); | 
| @@ -141,8 +137,7 @@ discard block | ||
| 141 | 137 | * @param $projectPath | 
| 142 | 138 | * @param OutputInterface $output | 
| 143 | 139 | */ | 
| 144 | - protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) | |
| 145 | -    { | |
| 140 | +    protected function finaliseSetup(array $options, $projectPath, OutputInterface $output) { | |
| 146 | 141 | $command = 'vagrant ssh -c \'cd /var/www/public; ../bin/n98-magerun.phar index:reindex:all;\''; | 
| 147 | 142 |          $output->writeln('<comment>Reindexing Tables</comment>'); | 
| 148 | 143 | new ProcessCommand($command, $projectPath, $output); | 
| @@ -166,8 +161,7 @@ discard block | ||
| 166 | 161 | * @param array $options | 
| 167 | 162 | * @param OutputInterface $output | 
| 168 | 163 | */ | 
| 169 | - protected function showCredentials(array $options, OutputInterface $output) | |
| 170 | -    { | |
| 164 | +    protected function showCredentials(array $options, OutputInterface $output) { | |
| 171 | 165 |          $output->writeln('<info>SUCCESS: Magestead has finished installing Magento!</info>'); | 
| 172 | 166 | $table = new Table($output); | 
| 173 | 167 | $table | 
| @@ -186,8 +180,7 @@ discard block | ||
| 186 | 180 | * @param OutputInterface $output | 
| 187 | 181 | * @return VersionControl | 
| 188 | 182 | */ | 
| 189 | - protected function processVcs(array $options, $projectPath, OutputInterface $output) | |
| 190 | -    { | |
| 183 | +    protected function processVcs(array $options, $projectPath, OutputInterface $output) { | |
| 191 | 184 |          if (!empty($options['repo_url'])) { | 
| 192 | 185 | copy($projectPath . "/puphpet/magestead/magento/stubs/gitignore.tmp", $projectPath . "/.gitignore"); | 
| 193 | 186 | return new VersionControl($options['repo_url'], $projectPath, $output); | 
| @@ -198,8 +191,7 @@ discard block | ||
| 198 | 191 | * @param $projectPath | 
| 199 | 192 | * @param OutputInterface $output | 
| 200 | 193 | */ | 
| 201 | - protected function composerInstall($projectPath, OutputInterface $output) | |
| 202 | -    { | |
| 194 | +    protected function composerInstall($projectPath, OutputInterface $output) { | |
| 203 | 195 | copy($projectPath . "/puphpet/magestead/magento/stubs/composer.tmp", $projectPath . "/composer.json"); | 
| 204 | 196 |          new ProcessCommand('composer install', $projectPath, $output); | 
| 205 | 197 | } | 
| @@ -207,8 +199,7 @@ discard block | ||
| 207 | 199 | /** | 
| 208 | 200 | * @param $projectPath | 
| 209 | 201 | */ | 
| 210 | - protected function configureRedis($projectPath) | |
| 211 | -    { | |
| 202 | +    protected function configureRedis($projectPath) { | |
| 212 | 203 | $this->updateConfigXml($projectPath); | 
| 213 | 204 | $this->activateModule($projectPath); | 
| 214 | 205 | } | 
| @@ -216,8 +207,7 @@ discard block | ||
| 216 | 207 | /** | 
| 217 | 208 | * @param $projectPath | 
| 218 | 209 | */ | 
| 219 | - protected function updateConfigXml($projectPath) | |
| 220 | -    { | |
| 210 | +    protected function updateConfigXml($projectPath) { | |
| 221 | 211 | $localFile = '/public/app/etc/local.xml'; | 
| 222 | 212 | $localXml = file_get_contents($projectPath . $localFile); | 
| 223 | 213 | |
| @@ -247,8 +237,7 @@ discard block | ||
| 247 | 237 | /** | 
| 248 | 238 | * @param $projectPath | 
| 249 | 239 | */ | 
| 250 | - protected function activateModule($projectPath) | |
| 251 | -    { | |
| 240 | +    protected function activateModule($projectPath) { | |
| 252 | 241 | $moduleFile = '/public/app/etc/modules/Cm_RedisSession.xml'; | 
| 253 | 242 | $moduleXml = file_get_contents($projectPath . $moduleFile); | 
| 254 | 243 | $config = new \SimpleXMLElement($moduleXml); | 
| @@ -262,8 +251,7 @@ discard block | ||
| 262 | 251 | * @param OutputInterface $output | 
| 263 | 252 | * @return ProcessCommand | 
| 264 | 253 | */ | 
| 265 | - protected function configureTestSuites(array $options, $projectPath, OutputInterface $output) | |
| 266 | -    { | |
| 254 | +    protected function configureTestSuites(array $options, $projectPath, OutputInterface $output) { | |
| 267 | 255 |          $output->writeln('<info>Configuring PHPSpec & Behat Suites</info>'); | 
| 268 | 256 | $progress = new ProgressBar($output, 2); | 
| 269 | 257 | |
| @@ -285,8 +273,7 @@ discard block | ||
| 285 | 273 | * @param OutputInterface $output | 
| 286 | 274 | * @return bool|mixed | 
| 287 | 275 | */ | 
| 288 | - protected function getBehatConfig(array $options, $projectPath, OutputInterface $output) | |
| 289 | -    { | |
| 276 | +    protected function getBehatConfig(array $options, $projectPath, OutputInterface $output) { | |
| 290 | 277 | $yaml = new Parser(); | 
| 291 | 278 |          try { | 
| 292 | 279 | $behat = $yaml->parse(file_get_contents($projectPath . "/puphpet/magestead/magento/stubs/behat.yml")); | 
| @@ -305,8 +292,7 @@ discard block | ||
| 305 | 292 | * @param $behat | 
| 306 | 293 | * @param $progress | 
| 307 | 294 | */ | 
| 308 | - protected function saveBehatConfig($projectPath, OutputInterface $output, $behat, $progress) | |
| 309 | -    { | |
| 295 | +    protected function saveBehatConfig($projectPath, OutputInterface $output, $behat, $progress) { | |
| 310 | 296 | $dumper = new Dumper(); | 
| 311 | 297 | $yaml = $dumper->dump($behat, 6); | 
| 312 | 298 |          try { | 
| @@ -16,8 +16,7 @@ discard block | ||
| 16 | 16 | protected $_config; | 
| 17 | 17 | protected $_projectPath; | 
| 18 | 18 | |
| 19 | - protected function configure() | |
| 20 | -    { | |
| 19 | +    protected function configure() { | |
| 21 | 20 | $this->_projectPath = getcwd(); | 
| 22 | 21 |          $this->setName("index:mode:set"); | 
| 23 | 22 |          $this->setDescription("Set index mode type"); | 
| @@ -29,8 +28,7 @@ discard block | ||
| 29 | 28 | * @param OutputInterface $output | 
| 30 | 29 | * @return ProcessCommand | 
| 31 | 30 | */ | 
| 32 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 33 | -    { | |
| 31 | +    protected function execute(InputInterface $input, OutputInterface $output) { | |
| 34 | 32 |          $mode = $input->getArgument('mode'); | 
| 35 | 33 | $command = $this->getCommand(new Config($output), $mode); | 
| 36 | 34 |          if ($command) { | 
| @@ -47,8 +45,7 @@ discard block | ||
| 47 | 45 | * @param $mode | 
| 48 | 46 | * @return bool|string | 
| 49 | 47 | */ | 
| 50 | - protected function getCommand(Config $config, $mode) | |
| 51 | -    { | |
| 48 | +    protected function getCommand(Config $config, $mode) { | |
| 52 | 49 | $type = $config->type; | 
| 53 | 50 |          switch ($type) { | 
| 54 | 51 | case 'magento2': | 
| @@ -16,8 +16,7 @@ discard block | ||
| 16 | 16 | protected $_config; | 
| 17 | 17 | protected $_projectPath; | 
| 18 | 18 | |
| 19 | - protected function configure() | |
| 20 | -    { | |
| 19 | +    protected function configure() { | |
| 21 | 20 | $this->_projectPath = getcwd(); | 
| 22 | 21 |          $this->setName("index:reindex"); | 
| 23 | 22 |          $this->setDescription("Reindex data"); | 
| @@ -29,8 +28,7 @@ discard block | ||
| 29 | 28 | * @param OutputInterface $output | 
| 30 | 29 | * @return ProcessCommand | 
| 31 | 30 | */ | 
| 32 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 33 | -    { | |
| 31 | +    protected function execute(InputInterface $input, OutputInterface $output) { | |
| 34 | 32 |          $output->writeln('<info>Reindexing data</info>'); | 
| 35 | 33 |          $index = $input->getArgument('index'); | 
| 36 | 34 | |
| @@ -44,8 +42,7 @@ discard block | ||
| 44 | 42 | * @param $index | 
| 45 | 43 | * @return bool|string | 
| 46 | 44 | */ | 
| 47 | - protected function getCommand(Config $config, $index) | |
| 48 | -    { | |
| 45 | +    protected function getCommand(Config $config, $index) { | |
| 49 | 46 | $type = $config->type; | 
| 50 | 47 |          switch ($type) { | 
| 51 | 48 | case 'magento': | 
| @@ -14,8 +14,7 @@ discard block | ||
| 14 | 14 | protected $_config; | 
| 15 | 15 | protected $_projectPath; | 
| 16 | 16 | |
| 17 | - protected function configure() | |
| 18 | -    { | |
| 17 | +    protected function configure() { | |
| 19 | 18 | $this->_projectPath = getcwd(); | 
| 20 | 19 |          $this->setName("redis:flush-all"); | 
| 21 | 20 |          $this->setDescription("Flush redis storage"); | 
| @@ -26,8 +25,7 @@ discard block | ||
| 26 | 25 | * @param OutputInterface $output | 
| 27 | 26 | * @return ProcessCommand | 
| 28 | 27 | */ | 
| 29 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 30 | -    { | |
| 28 | +    protected function execute(InputInterface $input, OutputInterface $output) { | |
| 31 | 29 |          $output->writeln('<info>Flushing Redis Storage</info>'); | 
| 32 | 30 | |
| 33 | 31 | $command = "redis-cli flushall"; | 
| @@ -16,8 +16,7 @@ discard block | ||
| 16 | 16 | * @param $projectPath | 
| 17 | 17 | * @param OutputInterface $output | 
| 18 | 18 | */ | 
| 19 | - public function __construct($command, $projectPath, OutputInterface $output) | |
| 20 | -    { | |
| 19 | +    public function __construct($command, $projectPath, OutputInterface $output) { | |
| 21 | 20 | $this->run($command, $projectPath, $output); | 
| 22 | 21 | } | 
| 23 | 22 | |
| @@ -26,8 +25,7 @@ discard block | ||
| 26 | 25 | * @param $projectPath | 
| 27 | 26 | * @param OutputInterface $output | 
| 28 | 27 | */ | 
| 29 | - protected function run($command, $projectPath, OutputInterface $output) | |
| 30 | -    { | |
| 28 | +    protected function run($command, $projectPath, OutputInterface $output) { | |
| 31 | 29 | $process = new Process($command, $projectPath, array_merge($_SERVER, $_ENV), null, null); | 
| 32 | 30 | |
| 33 | 31 |          $process->run(function ($type, $line) use ($output) { |