@@ -65,7 +65,7 @@ |
||
65 | 65 | public function doPhase($thingBeingPlayed = null) |
66 | 66 | { |
67 | 67 | // shorthand |
68 | - $st = $this->st; |
|
68 | + $st = $this->st; |
|
69 | 69 | |
70 | 70 | // our return value |
71 | 71 | $phaseResult = $this->getNewPhaseResult(); |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $phaseResult = $this->getNewPhaseResult(); |
74 | 74 | |
75 | 75 | // do we have anything to do? |
76 | - if (!$story->hasTestSetup()) |
|
77 | - { |
|
76 | + if (!$story->hasTestSetup()) { |
|
78 | 77 | $phaseResult->setContinuePlaying( |
79 | 78 | $phaseResult::HASNOACTIONS, |
80 | 79 | "story has no test setup instructions" |
@@ -122,8 +121,7 @@ discard block |
||
122 | 121 | ); |
123 | 122 | $storyResult->setStoryIsIncomplete($phaseResult); |
124 | 123 | } |
125 | - catch (Exception $e) |
|
126 | - { |
|
124 | + catch (Exception $e) { |
|
127 | 125 | // something went wrong ... the test cannot continue |
128 | 126 | $phaseResult->setPlayingFailed( |
129 | 127 | $phaseResult::ERROR, |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $phaseResult = $this->getNewPhaseResult(); |
74 | 74 | |
75 | 75 | // do we have anything to do? |
76 | - if (!$story->hasTestTeardown()) |
|
77 | - { |
|
76 | + if (!$story->hasTestTeardown()) { |
|
78 | 77 | $phaseResult->setContinuePlaying( |
79 | 78 | $phaseResult::HASNOACTIONS, |
80 | 79 | "story has no test teardown instructions" |
@@ -124,8 +123,7 @@ discard block |
||
124 | 123 | ); |
125 | 124 | $storyResult->setStoryIsIncomplete($phaseResult); |
126 | 125 | } |
127 | - catch (Exception $e) |
|
128 | - { |
|
126 | + catch (Exception $e) { |
|
129 | 127 | // we still want to continue at this stage |
130 | 128 | $phaseResult->setContinuePlaying( |
131 | 129 | $phaseResult::ERROR, |
@@ -78,8 +78,7 @@ discard block |
||
78 | 78 | public function startAction($message, $codeLine = null) |
79 | 79 | { |
80 | 80 | // do we have an open action? |
81 | - if (!$this->action || !$this->action->getIsOpen()) |
|
82 | - { |
|
81 | + if (!$this->action || !$this->action->getIsOpen()) { |
|
83 | 82 | $openItem = $this->action = new Action_LogItem($this->injectables, 1); |
84 | 83 | } |
85 | 84 | else { |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | public function closeAllOpenActions() |
94 | 93 | { |
95 | 94 | // do we have any empty log items? |
96 | - if (!$this->action) |
|
97 | - { |
|
95 | + if (!$this->action) { |
|
98 | 96 | return; |
99 | 97 | } |
100 | 98 |
@@ -60,7 +60,8 @@ |
||
60 | 60 | /** |
61 | 61 | * @param string $err |
62 | 62 | */ |
63 | - public function __construct($err) { |
|
63 | + public function __construct($err) |
|
64 | + { |
|
64 | 65 | $msg = "Invalid config - $err"; |
65 | 66 | parent::__construct(500, $msg, $msg); |
66 | 67 | } |
@@ -61,7 +61,8 @@ |
||
61 | 61 | /** |
62 | 62 | * @param string $key |
63 | 63 | */ |
64 | - public function __construct($key) { |
|
64 | + public function __construct($key) |
|
65 | + { |
|
65 | 66 | $msg = "No such data '{$key}' in the checkpoint"; |
66 | 67 | parent::__construct(500, $msg, $msg); |
67 | 68 | } |
@@ -61,7 +61,8 @@ |
||
61 | 61 | /** |
62 | 62 | * @param string $className |
63 | 63 | */ |
64 | - public function __construct($className) { |
|
64 | + public function __construct($className) |
|
65 | + { |
|
65 | 66 | $msg = "Class '{$className}' does not inherit from Prose\\Prose"; |
66 | 67 | parent::__construct(500, $msg, $msg); |
67 | 68 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | // |
69 | 69 | // we always search the generic 'Phases' namespace first, in case |
70 | 70 | // users don't want to uniquely namespace their Phase classes |
71 | - $this->namespaces = array ("Phases"); |
|
71 | + $this->namespaces = array("Phases"); |
|
72 | 72 | |
73 | 73 | // add in any additional namespaces we've been asked to search |
74 | 74 | foreach ($namespaces as $namespace) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function playPhases($activity, StoryTeller $st, Injectables $injectables, $phases, $thingBeingPlayed) |
79 | 79 | { |
80 | 80 | // shorthand |
81 | - $output = $st->getOutput(); |
|
81 | + $output = $st->getOutput(); |
|
82 | 82 | |
83 | 83 | // we are going to need something to help us load each of our |
84 | 84 | // phases |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | // the result of playing this group of phases |
100 | 100 | $groupResult = null; |
101 | - if ($thingBeingPlayed){ |
|
101 | + if ($thingBeingPlayed) { |
|
102 | 102 | $groupResult = $thingBeingPlayed->getResult(); |
103 | 103 | $groupResult->setActivity($activity); |
104 | 104 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | // the result of playing this group of phases |
100 | 100 | $groupResult = null; |
101 | - if ($thingBeingPlayed){ |
|
101 | + if ($thingBeingPlayed) { |
|
102 | 102 | $groupResult = $thingBeingPlayed->getResult(); |
103 | 103 | $groupResult->setActivity($activity); |
104 | 104 | } |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | // |
111 | 111 | // 1. all listed phases have been executed, or |
112 | 112 | // 2. one of the phases says that the story has failed |
113 | - foreach ($phasesToPlay as $phaseName => $phaseData) |
|
114 | - { |
|
113 | + foreach ($phasesToPlay as $phaseName => $phaseData) { |
|
115 | 114 | // shorthand |
116 | 115 | $phase = $phaseData['phase']; |
117 | 116 | $isActive = $phaseData['isActive']; |
@@ -128,8 +127,7 @@ discard block |
||
128 | 127 | |
129 | 128 | // now, what do we do? |
130 | 129 | $nextAction = $phaseResult->getNextAction(); |
131 | - switch ($nextAction) |
|
132 | - { |
|
130 | + switch ($nextAction) { |
|
133 | 131 | case self::NEXT_SKIP: |
134 | 132 | // why? |
135 | 133 | if ($phaseResult->getPhaseIsBlacklisted()) { |