@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$this->baseUrl = 'http://magento19.loc//'; |
|
4 | 3 | \ No newline at end of file |
4 | +$this->baseUrl = 'http://magento19.loc//'; |
|
5 | 5 | \ No newline at end of file |
@@ -2,4 +2,4 @@ |
||
2 | 2 | |
3 | 3 | namespace Magium\Extractors\Navigation; |
4 | 4 | |
5 | -class UnableToExtractMenuXpathException extends \Exception{} |
|
6 | 5 | \ No newline at end of file |
6 | +class UnableToExtractMenuXpathException extends \Exception {} |
|
7 | 7 | \ No newline at end of file |
@@ -2,4 +2,4 @@ |
||
2 | 2 | |
3 | 3 | namespace Magium\Extractors\Navigation; |
4 | 4 | |
5 | -class MissingNavigationSchemeException extends \Exception{} |
|
6 | 5 | \ No newline at end of file |
6 | +class MissingNavigationSchemeException extends \Exception {} |
|
7 | 7 | \ No newline at end of file |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $this->name = trim(array_pop($rows)); |
32 | 32 | while (count($rows) > 0) { |
33 | 33 | $row = array_shift($rows); |
34 | - if (strpos($row, 'T: ') ===0) { |
|
34 | + if (strpos($row, 'T: ') === 0) { |
|
35 | 35 | $this->phone = trim(substr($row, 3)); |
36 | 36 | continue; |
37 | - } else if (strpos($row, 'F: ') ===0) { |
|
37 | + } else if (strpos($row, 'F: ') === 0) { |
|
38 | 38 | $this->fax = trim(substr($row, 3)); |
39 | 39 | continue; |
40 | 40 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->street1 = trim(array_shift($rows)); |
60 | 60 | $this->business = trim(array_shift($rows)); |
61 | 61 | //Easy |
62 | - }else if (count($rows) == 1) { |
|
62 | + } else if (count($rows) == 1) { |
|
63 | 63 | $this->street1 = trim(array_shift($rows)); |
64 | 64 | |
65 | 65 | // Not so easy |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | $this->street1 = $stOrBus; |
71 | 71 | $this->business = trim(array_shift($rows)); |
72 | 72 | } else { |
73 | - $this->street1 =trim(array_shift($rows)); |
|
74 | - $this->street2 = $stOrBus; |
|
73 | + $this->street1 = trim(array_shift($rows)); |
|
74 | + $this->street2 = $stOrBus; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public static function elementExists($selector, $by = 'byId') |
12 | 12 | { |
13 | 13 | return new WebDriverExpectedCondition( |
14 | - function ($driver) use ($selector, $by) { |
|
14 | + function($driver) use ($selector, $by) { |
|
15 | 15 | try { |
16 | 16 | $element = $driver->$by($selector); |
17 | 17 | return $element instanceof WebDriverElement; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public static function elementRemoved(WebDriverElement $element) |
27 | 27 | { |
28 | 28 | return new WebDriverExpectedCondition( |
29 | - function () use ($element) { |
|
29 | + function() use ($element) { |
|
30 | 30 | try { |
31 | 31 | $element->isDisplayed(); |
32 | 32 | return false; |
@@ -279,7 +279,6 @@ |
||
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
282 | - |
|
283 | 282 | * @param string $theme |
284 | 283 | * @return \Magium\Themes\ThemeConfigurationInterface |
285 | 284 | */ |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
199 | - public static function resolveClass( $class, $prefix = null) |
|
199 | + public static function resolveClass($class, $prefix = null) |
|
200 | 200 | { |
201 | 201 | $origClass = $class; |
202 | 202 | if ($prefix !== null) { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | foreach (self::$baseNamespaces as $namespace) { |
213 | - $fqClass = $namespace . '\\' . $class; |
|
213 | + $fqClass = $namespace.'\\'.$class; |
|
214 | 214 | try { |
215 | 215 | if (class_exists($fqClass)) { |
216 | 216 | return $fqClass; |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | try { |
498 | 498 | $this->byXpath(sprintf('//%s[contains(., "%s")]', $node, addslashes($text))); |
499 | 499 | } catch (\Exception $e) { |
500 | - $this->fail('The body did not contain the text: ' . $text); |
|
500 | + $this->fail('The body did not contain the text: '.$text); |
|
501 | 501 | } |
502 | 502 | } |
503 | 503 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $this->webdriver->byXpath(sprintf('//body[contains(., "%s")]', $text)); |
508 | 508 | // If the element is not found then an exception will be thrown |
509 | 509 | } catch (\Exception $e) { |
510 | - $this->fail('The body did not contain the text: ' . $text); |
|
510 | + $this->fail('The body did not contain the text: '.$text); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | } |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | { |
517 | 517 | try { |
518 | 518 | $this->webdriver->byXpath(sprintf('//body[contains(., "%s")]', $text)); |
519 | - $this->fail('The page contains the words: ' . $text); |
|
519 | + $this->fail('The page contains the words: '.$text); |
|
520 | 520 | } catch (NoSuchElementException $e) { |
521 | 521 | // Exception thrown is a success |
522 | 522 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | { |
557 | 557 | |
558 | 558 | if ($parentElementSelector !== null) { |
559 | - $xpathTemplate = $parentElementSelector . $xpathTemplate; |
|
559 | + $xpathTemplate = $parentElementSelector.$xpathTemplate; |
|
560 | 560 | } |
561 | 561 | if ($specificNodeType !== null) { |
562 | 562 | return $this->byXpath(sprintf($xpathTemplate, $specificNodeType, $this->getTranslator()->translatePlaceholders($text))); |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | } |
570 | 570 | } |
571 | 571 | // This is here for consistency with the other by* methods |
572 | - WebDriverException::throwException(7, 'Could not find element with text: ' . $this->getTranslator()->translatePlaceholders($text), []); |
|
572 | + WebDriverException::throwException(7, 'Could not find element with text: '.$this->getTranslator()->translatePlaceholders($text), []); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | /** |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function __call($name, $arguments) |
28 | 28 | { |
29 | 29 | if (strpos($name, '::') > 0) { |
30 | - list( , $name) = explode('::', $name); |
|
30 | + list(, $name) = explode('::', $name); |
|
31 | 31 | } |
32 | 32 | if (!$this->element instanceof WebDriverElement) { |
33 | 33 | $this->element = $this->webDriver->{$this->by}($this->selector); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ) |
20 | 20 | { |
21 | 21 | if (!is_dir($configDir)) { |
22 | - throw new NotFoundException('Configuration dir not found: ' . $configDir); |
|
22 | + throw new NotFoundException('Configuration dir not found: '.$configDir); |
|
23 | 23 | } |
24 | 24 | $this->config = $configDir; |
25 | 25 | |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | |
29 | 29 | public function load() |
30 | 30 | { |
31 | - self::addCommandDir('Magium\Cli\Command', __DIR__ . '/Command'); |
|
31 | + self::addCommandDir('Magium\Cli\Command', __DIR__.'/Command'); |
|
32 | 32 | |
33 | 33 | foreach (self::$dirs as $namespace => $dir) { |
34 | - $files = glob($dir . '/*.php'); |
|
34 | + $files = glob($dir.'/*.php'); |
|
35 | 35 | |
36 | 36 | foreach ($files as $file) { |
37 | 37 | $class = substr(basename($file), 0, -4); |
38 | - $className = $namespace . '\\' . $class; |
|
38 | + $className = $namespace.'\\'.$class; |
|
39 | 39 | if (class_exists($className)) { |
40 | 40 | $reflection = new \ReflectionClass($className); |
41 | 41 | if (!$reflection->isInstantiable()) { |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | |
35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
36 | 36 | { |
37 | - if (!file_exists($this->path . '/magium.json')) { |
|
37 | + if (!file_exists($this->path.'/magium.json')) { |
|
38 | 38 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
39 | 39 | } |
40 | 40 | $reader = new \Zend\Config\Reader\Json(); |
41 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
41 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
42 | 42 | |
43 | 43 | $class = $input->getArgument('class'); |
44 | 44 | $property = $input->getArgument('property'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $config->magium = []; |
52 | 52 | } |
53 | 53 | if (!class_exists($class)) { |
54 | - throw new NotFoundException('Could not find class: ' . $class . '. You might need to escape blackslashes (\\\\)'); |
|
54 | + throw new NotFoundException('Could not find class: '.$class.'. You might need to escape blackslashes (\\\\)'); |
|
55 | 55 | } |
56 | 56 | $class = strtolower($class); |
57 | 57 | $s = $config->magium; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $s[$class]->$property = $value; |
63 | 63 | |
64 | 64 | $writer = new Json(); |
65 | - $writer->toFile($this->path . '/magium.json', $config); |
|
65 | + $writer->toFile($this->path.'/magium.json', $config); |
|
66 | 66 | $output->writeln(sprintf('Wrote value %s for "%s:%s" to %s/magium.json', $value, $class, $property, $this->path)); |
67 | 67 | } |
68 | 68 |