@@ -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 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | try { |
33 | 33 | $assertion->assert(); |
34 | - $this->logger->logAssertionSuccess( $assertion, $extra ); |
|
34 | + $this->logger->logAssertionSuccess($assertion, $extra); |
|
35 | 35 | } catch (\Exception $e) { |
36 | 36 | $this->logger->logAssertionFailure($assertion, $extra); |
37 | 37 | throw $e; |
@@ -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; |
@@ -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); |
@@ -5,13 +5,9 @@ |
||
5 | 5 | use Guzzle\Http\Client; |
6 | 6 | use Magium\Cli\Command\Test\TestSkeleton; |
7 | 7 | use Magium\InvalidConfigurationException; |
8 | -use Magium\NotFoundException; |
|
9 | 8 | use Magium\Util\Api\ApiConfiguration; |
10 | 9 | use Symfony\Component\Console\Command\Command; |
11 | -use Symfony\Component\Console\Input\ArrayInput; |
|
12 | -use Symfony\Component\Console\Input\InputArgument; |
|
13 | 10 | use Symfony\Component\Console\Input\InputInterface; |
14 | -use Symfony\Component\Console\Input\InputOption; |
|
15 | 11 | use Symfony\Component\Console\Output\OutputInterface; |
16 | 12 | |
17 | 13 | class ApiPing extends Command |
@@ -31,26 +31,26 @@ discard block |
||
31 | 31 | $api = $test->get('Magium\Util\Api\ApiConfiguration'); |
32 | 32 | /* @var $api ApiConfiguration */ |
33 | 33 | if (!$api instanceof ApiConfiguration) { |
34 | - throw new InvalidConfigurationException('Did not receive an instance of ApiConfiguration; received ' . get_class($api)); |
|
34 | + throw new InvalidConfigurationException('Did not receive an instance of ApiConfiguration; received '.get_class($api)); |
|
35 | 35 | } |
36 | 36 | $api->setEnabled(true); // Gotta force this for this test |
37 | 37 | |
38 | 38 | $output->writeln('Sending un-authenticated payload...'); |
39 | - $client = new Client('http://' . $api->getApiHostname(). '/api/ping'); |
|
39 | + $client = new Client('http://'.$api->getApiHostname().'/api/ping'); |
|
40 | 40 | $request = $client->get(); |
41 | 41 | $response = $request->send(); |
42 | 42 | $output->writeln( |
43 | 43 | 'Checking for 200 status message... ' |
44 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
44 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
45 | 45 | ); |
46 | 46 | $output->writeln( |
47 | 47 | 'Checking for application/json content type... ' |
48 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
48 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
49 | 49 | ); |
50 | 50 | $content = json_decode($response->getBody(), true); |
51 | 51 | $output->writeln( |
52 | 52 | 'Checking for successful response... ' |
53 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
53 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | $output->writeln(''); |
@@ -62,16 +62,16 @@ discard block |
||
62 | 62 | |
63 | 63 | $output->writeln( |
64 | 64 | 'Checking for 200 status message... ' |
65 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
65 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
66 | 66 | ); |
67 | 67 | $output->writeln( |
68 | 68 | 'Checking for application/json content type... ' |
69 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
69 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
70 | 70 | ); |
71 | 71 | $content = $request->getPayload($response); |
72 | 72 | $output->writeln( |
73 | 73 | 'Checking for successful response... ' |
74 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
74 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
75 | 75 | ); |
76 | 76 | |
77 | 77 | |
@@ -82,20 +82,20 @@ discard block |
||
82 | 82 | $response = $request->push('/api/echo-authed', ['message' => 'hello world']); |
83 | 83 | $output->writeln( |
84 | 84 | 'Checking for 200 status message... ' |
85 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
85 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
86 | 86 | ); |
87 | 87 | $output->writeln( |
88 | 88 | 'Checking for application/json content type... ' |
89 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
89 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
90 | 90 | ); |
91 | 91 | $content = $request->getPayload($response); |
92 | 92 | $output->writeln( |
93 | 93 | 'Checking for successful response... ' |
94 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
94 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
95 | 95 | ); |
96 | 96 | $output->writeln( |
97 | 97 | 'Checking for matching echo message... ' |
98 | - . (is_array($content) && isset($content['message']) && $content['message'] === 'hello world'?'OK':'Failed') |
|
98 | + . (is_array($content) && isset($content['message']) && $content['message'] === 'hello world' ? 'OK' : 'Failed') |
|
99 | 99 | ); |
100 | 100 | } |
101 | 101 |
@@ -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()) { |