@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | $this->logStatus($status, $instanceName, $instancePort); |
37 | 37 | |
38 | - if ($status === self::VALID_INSTANCE){ |
|
38 | + if ($status === self::VALID_INSTANCE) { |
|
39 | 39 | $this->register($instanceName, $instancePort); |
40 | 40 | $this->log(self::SUCCESS_MESSAGE_ADDED, $instanceName); |
41 | 41 | } |
@@ -88,13 +88,13 @@ |
||
88 | 88 | |
89 | 89 | // Warn if Chrome or Firefox binaries are not available. |
90 | 90 | if ($chromeVersion = $this->env->getChromeVersion()) { |
91 | - $this->output->writeln('Chrome binary found, v.'. $chromeVersion); |
|
91 | + $this->output->writeln('Chrome binary found, v.' . $chromeVersion); |
|
92 | 92 | } else { |
93 | 93 | $this->output->writeln('<info>WARNING: Chrome binary not found.</info>'); |
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($firefoxVersion = $this->env->getFirefoxVersion()) { |
97 | - $this->output->writeln('Firefox binary found, v.'. $firefoxVersion); |
|
97 | + $this->output->writeln('Firefox binary found, v.' . $firefoxVersion); |
|
98 | 98 | } else { |
99 | 99 | $this->output->writeln('<info>WARNING: Firefox binary not found.</info>'); |
100 | 100 | } |
@@ -54,29 +54,29 @@ discard block |
||
54 | 54 | $writeln[] = '<error>[ ] Your Java version needs to be >= 1.6</error>'; |
55 | 55 | $canInstall = false; |
56 | 56 | } else { |
57 | - $writeln[] = '<info>[x] Your Java version '. $javaVersion .' seems up to date.</info>'; |
|
57 | + $writeln[] = '<info>[x] Your Java version ' . $javaVersion . ' seems up to date.</info>'; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | 61 | if ($this->isPHPVersionDeprecated()) { |
62 | - $writeln[] = '<error>[ ] Your PHP version '. $this->getPHPVersion() .' should be >= 5.3</error>'; |
|
62 | + $writeln[] = '<error>[ ] Your PHP version ' . $this->getPHPVersion() . ' should be >= 5.3</error>'; |
|
63 | 63 | $canInstall = false; |
64 | 64 | } else { |
65 | - $writeln[] = '<info>[x] Your PHP version is '. $this->getPHPVersion() .'</info>'; |
|
65 | + $writeln[] = '<info>[x] Your PHP version is ' . $this->getPHPVersion() . '</info>'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if (!$this->hasPHPCurlExtInstalled()) { |
69 | 69 | $writeln[] = '<error>[ ] cURL extension for PHP is missing.</error>'; |
70 | 70 | $canInstall = false; |
71 | 71 | } else { |
72 | - $writeln[] = '<info>[x] cURL '. $this->getPHPCurlExtVersion() .' extension is installed.</info>'; |
|
72 | + $writeln[] = '<info>[x] cURL ' . $this->getPHPCurlExtVersion() . ' extension is installed.</info>'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$this->hasPHPOpenSSLExtInstalled()) { |
76 | 76 | $writeln[] = '<error>[ ] OpenSSL extension for PHP is missing.</error>'; |
77 | 77 | $canInstall = false; |
78 | 78 | } else { |
79 | - $writeln[] = '<info>[x] '. $this->getPHPOpenSSLExtVersion() .' extension is installed.</info>'; |
|
79 | + $writeln[] = '<info>[x] ' . $this->getPHPOpenSSLExtVersion() . ' extension is installed.</info>'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->output->writeln($writeln); |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | $lookForNegative = '^System error'; |
138 | 138 | |
139 | 139 | } else { |
140 | - $cmd ='sudo -n true'; |
|
140 | + $cmd = 'sudo -n true'; |
|
141 | 141 | $lookForNegative = '^sudo\: a password is required'; |
142 | 142 | } |
143 | 143 | |
144 | 144 | $output = new BufferedOutput(); |
145 | 145 | |
146 | 146 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
147 | - $process->run(function ($type, $line) use ($output) { |
|
147 | + $process->run(function($type, $line) use ($output) { |
|
148 | 148 | $output->write($line); |
149 | 149 | }); |
150 | 150 | |
151 | - return !(preg_match('/'. $lookForNegative .'/is', $output->fetch())); |
|
151 | + return !(preg_match('/' . $lookForNegative . '/is', $output->fetch())); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public function getJavaVersion() |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $output = new BufferedOutput(); |
159 | 159 | |
160 | 160 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
161 | - $process->run(function ($type, $line) use ($output) { |
|
161 | + $process->run(function($type, $line) use ($output) { |
|
162 | 162 | $output->write($line); |
163 | 163 | }); |
164 | 164 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public function setEnvVar($varName, $varValue = '') |
238 | 238 | { |
239 | 239 | if ($varValue != '') { |
240 | - putenv($varName. '=' .$varValue); |
|
240 | + putenv($varName . '=' . $varValue); |
|
241 | 241 | } else { |
242 | 242 | putenv($varName); |
243 | 243 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // $progress->start(); |
278 | 278 | $output = new BufferedOutput(); |
279 | 279 | |
280 | - $request->getEmitter()->on('progress', function (ProgressEvent $e) use ($computeRemainingSize, $output) { |
|
280 | + $request->getEmitter()->on('progress', function(ProgressEvent $e) use ($computeRemainingSize, $output) { |
|
281 | 281 | |
282 | 282 | $output->write( |
283 | 283 | sprintf("Downloaded %s%%\r", $computeRemainingSize($e)) |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $output = $this->output; |
306 | 306 | |
307 | 307 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
308 | - $process->run(function ($type, $line) use ($output) { |
|
308 | + $process->run(function($type, $line) use ($output) { |
|
309 | 309 | $output->write($line); |
310 | 310 | }); |
311 | 311 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $output = $this->output; |
324 | 324 | |
325 | 325 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
326 | - $process->run(function ($type, $line) use ($output) { |
|
326 | + $process->run(function($type, $line) use ($output) { |
|
327 | 327 | $output->write($line); |
328 | 328 | }); |
329 | 329 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $output = $this->output; |
342 | 342 | |
343 | 343 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
344 | - $process->run(function ($type, $line) use ($output) { |
|
344 | + $process->run(function($type, $line) use ($output) { |
|
345 | 345 | $output->write($line); |
346 | 346 | }); |
347 | 347 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $output = new BufferedOutput(); |
360 | 360 | |
361 | 361 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
362 | - $process->run(function ($type, $line) use ($output) { |
|
362 | + $process->run(function($type, $line) use ($output) { |
|
363 | 363 | $output->write($line); |
364 | 364 | }); |
365 | 365 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | $cmd = sprintf($cmd, $file); |
396 | 396 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
397 | - $process->run(function ($type, $line) use ($output) { |
|
397 | + $process->run(function($type, $line) use ($output) { |
|
398 | 398 | $output->write($line); |
399 | 399 | }); |
400 | 400 | } |
@@ -405,14 +405,14 @@ discard block |
||
405 | 405 | // @todo Refactor this in 5.0; split binaries and drivers; Add Opera. |
406 | 406 | // @see https://github.com/bogdananton/Selenium-Setup/issues/12 |
407 | 407 | $cmdExtra = ''; |
408 | - if ($binary = $this->config->getBinary('chromedriver.'. $this->getOsName() .'.'. $this->getOsType())) { |
|
408 | + if ($binary = $this->config->getBinary('chromedriver.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
409 | 409 | $cmdExtra .= sprintf(' -Dwebdriver.chrome.driver=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
410 | 410 | } |
411 | - if ($binary = $this->config->getBinary('iedriver.'. $this->getOsName() .'.'.$this->getOsType())) { |
|
412 | - $cmdExtra .= sprintf(' -Dwebdriver.ie.driver=%s', $this->config->getBuildPath(). DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
411 | + if ($binary = $this->config->getBinary('iedriver.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
412 | + $cmdExtra .= sprintf(' -Dwebdriver.ie.driver=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
413 | 413 | } |
414 | - if ($binary = $this->config->getBinary('phantomjs.'. $this->getOsName() .'.'.$this->getOsType())) { |
|
415 | - $cmdExtra .= sprintf(' -Dphantomjs.binary.path=%s', $this->config->getBuildPath(). DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
414 | + if ($binary = $this->config->getBinary('phantomjs.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
415 | + $cmdExtra .= sprintf(' -Dphantomjs.binary.path=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($this->isWindows()) { |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | $output = new BufferedOutput(); |
463 | 463 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
464 | - $process->run(function ($type, $line) use ($output) { |
|
464 | + $process->run(function($type, $line) use ($output) { |
|
465 | 465 | $output->write($line); |
466 | 466 | }); |
467 | 467 | //var_dump($process->getPid()); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $output = new BufferedOutput(); |
482 | 482 | |
483 | 483 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
484 | - $process->run(function ($type, $line) use ($output) { |
|
484 | + $process->run(function($type, $line) use ($output) { |
|
485 | 485 | $output->write($line); |
486 | 486 | }); |
487 | 487 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $output = new BufferedOutput(); |
503 | 503 | |
504 | 504 | $process = new Process($cmd, SeleniumSetup::$APP_ROOT_PATH, SeleniumSetup::$APP_PROCESS_ENV, null, null); |
505 | - $process->run(function ($type, $line) use ($output) { |
|
505 | + $process->run(function($type, $line) use ($output) { |
|
506 | 506 | $output->write($line); |
507 | 507 | }); |
508 | 508 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | $contents = $this->fileSystem->readFile(SeleniumSetup::$APP_ROOT_PATH . DIRECTORY_SEPARATOR . SeleniumSetup::DEFAULT_LOCK_FILENAME); |
27 | - $lockerRaw = json_decode($contents); |
|
27 | + $lockerRaw = json_decode($contents); |
|
28 | 28 | foreach ($lockerRaw as $serverObj) { |
29 | 29 | $this->addServer(ServerItemFactory::createFromObj($serverObj)); |
30 | 30 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $console->setDefaultCommand(self::APP_DEFAULT_COMMAND); |
46 | 46 | |
47 | 47 | $dispatcher = new EventDispatcher(); |
48 | - $dispatcher->addListener(ConsoleEvents::COMMAND, function (ConsoleCommandEvent $event) { |
|
48 | + $dispatcher->addListener(ConsoleEvents::COMMAND, function(ConsoleCommandEvent $event) { |
|
49 | 49 | // get the input instance |
50 | 50 | // $input = $event->getInput(); |
51 | 51 |