@@ -20,24 +20,24 @@ |
||
20 | 20 | |
21 | 21 | $events = 0; |
22 | 22 | while(true) { |
23 | - try { |
|
24 | - $readable = $writeable = []; |
|
25 | - $events = $poller->poll($readable, $writeable, -1); |
|
26 | - } |
|
27 | - catch (Exception $e) { |
|
28 | - // do nothing |
|
29 | - } |
|
23 | + try { |
|
24 | + $readable = $writeable = []; |
|
25 | + $events = $poller->poll($readable, $writeable, -1); |
|
26 | + } |
|
27 | + catch (Exception $e) { |
|
28 | + // do nothing |
|
29 | + } |
|
30 | 30 | |
31 | - if ($events > 0) { |
|
32 | - foreach($readable as $r) { |
|
33 | - if ($r === $single['in']) { |
|
34 | - $msg = $r->recv(); |
|
35 | - $single['out']->send($msg); |
|
36 | - } |
|
37 | - else { |
|
38 | - $msg = $r->recvmulti(); |
|
39 | - $multi['out']->sendmulti($msg); |
|
40 | - } |
|
41 | - } |
|
42 | - } |
|
31 | + if ($events > 0) { |
|
32 | + foreach($readable as $r) { |
|
33 | + if ($r === $single['in']) { |
|
34 | + $msg = $r->recv(); |
|
35 | + $single['out']->send($msg); |
|
36 | + } |
|
37 | + else { |
|
38 | + $msg = $r->recvmulti(); |
|
39 | + $multi['out']->sendmulti($msg); |
|
40 | + } |
|
41 | + } |
|
42 | + } |
|
43 | 43 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | $single = array(); |
6 | 6 | $single['in'] = $context->getSocket(ZMQ::SOCKET_PULL); |
7 | 7 | $single['out'] = $context->getSocket(ZMQ::SOCKET_PUSH); |
8 | -$multi = array(); |
|
8 | +$multi = array(); |
|
9 | 9 | $multi['in'] = $context->getSocket(ZMQ::SOCKET_PULL); |
10 | 10 | $multi['out'] = $context->getSocket(ZMQ::SOCKET_PUSH); |
11 | 11 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $poller->add($multi['in'], ZMQ::POLL_IN); |
20 | 20 | |
21 | 21 | $events = 0; |
22 | -while(true) { |
|
22 | +while (true) { |
|
23 | 23 | try { |
24 | 24 | $readable = $writeable = []; |
25 | 25 | $events = $poller->poll($readable, $writeable, -1); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | if ($events > 0) { |
32 | - foreach($readable as $r) { |
|
32 | + foreach ($readable as $r) { |
|
33 | 33 | if ($r === $single['in']) { |
34 | 34 | $msg = $r->recv(); |
35 | 35 | $single['out']->send($msg); |
@@ -9,14 +9,14 @@ |
||
9 | 9 | |
10 | 10 | $group1 = $testEnv->newGroup('vagrant', new Vagrant_GroupAdapter); |
11 | 11 | $group1->newHost('default', new Vagrant_VirtualboxHostAdapter) |
12 | - ->setOperatingSystem(new Ubuntu_1504_HostAdapter) |
|
13 | - ->setRoles([ |
|
12 | + ->setOperatingSystem(new Ubuntu_1504_HostAdapter) |
|
13 | + ->setRoles([ |
|
14 | 14 | "host_target", |
15 | 15 | "upload_target", |
16 | 16 | "ssl_target", |
17 | 17 | "zmq_target", |
18 | 18 | ]) |
19 | - ->setStorySettings((object)[ |
|
19 | + ->setStorySettings((object)[ |
|
20 | 20 | "host" => (object)[ |
21 | 21 | "expected" => "successfully retrieved this storySetting :)", |
22 | 22 | ], |
@@ -59,7 +59,7 @@ |
||
59 | 59 | * __construct |
60 | 60 | * |
61 | 61 | * @param StoryTeller $st The StoryTeller object |
62 | - * @param array $args Any arguments to be used in this Prose module |
|
62 | + * @param string[] $args Any arguments to be used in this Prose module |
|
63 | 63 | * |
64 | 64 | * @return parent::__construct |
65 | 65 | */ |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $this->setLongDescription( |
68 | 68 | "Use this command to get a list of all of the machines (physical or VM)" |
69 | 69 | . " that are currently listed in Storyplayer's hoststable." |
70 | - .PHP_EOL .PHP_EOL |
|
70 | + .PHP_EOL . PHP_EOL |
|
71 | 71 | ."This can help you to identify VMs that have been left running after " |
72 | 72 | ."a test has completed." |
73 | 73 | .PHP_EOL |
@@ -270,8 +270,8 @@ |
||
270 | 270 | public function logCliErrorWithException($msg, $e) |
271 | 271 | { |
272 | 272 | $this->write("*** error: $msg" . PHP_EOL . PHP_EOL |
273 | - . "This was caused by an unexpected exception " . get_class($e) . PHP_EOL . PHP_EOL |
|
274 | - . $e->getTraceAsString() . PHP_EOL); |
|
273 | + . "This was caused by an unexpected exception " . get_class($e) . PHP_EOL . PHP_EOL |
|
274 | + . $e->getTraceAsString() . PHP_EOL); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_StoryShouldFail extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct() { |
|
60 | + public function __construct() |
|
61 | + { |
|
61 | 62 | $msg = "Story should fail"; |
62 | 63 | parent::__construct(400, $msg, $msg); |
63 | 64 | } |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_StoryShouldFail extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct() { |
|
60 | + public function __construct() |
|
61 | + { |
|
61 | 62 | $msg = "Story should fail"; |
62 | 63 | parent::__construct(400, $msg, $msg); |
63 | 64 | } |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_StoryShouldFail extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct() { |
|
60 | + public function __construct() |
|
61 | + { |
|
61 | 62 | $msg = "Story should fail"; |
62 | 63 | parent::__construct(400, $msg, $msg); |
63 | 64 | } |
@@ -104,15 +104,13 @@ |
||
104 | 104 | public function stop() |
105 | 105 | { |
106 | 106 | // stop the web browser |
107 | - if (is_object($this->browserSession)) |
|
108 | - { |
|
107 | + if (is_object($this->browserSession)) { |
|
109 | 108 | $this->browserSession->close(); |
110 | 109 | $this->browserSession = null; |
111 | 110 | } |
112 | 111 | |
113 | 112 | // now stop the proxy |
114 | - if (is_object($this->proxySession)) |
|
115 | - { |
|
113 | + if (is_object($this->proxySession)) { |
|
116 | 114 | try { |
117 | 115 | $this->proxySession->close(); |
118 | 116 | } |