@@ -100,7 +100,8 @@ |
||
100 | 100 | $this->silentActivity = true; |
101 | 101 | } |
102 | 102 | |
103 | - public function __construct($args) { |
|
103 | + public function __construct($args) |
|
104 | + { |
|
104 | 105 | if (isset($args['filename'])) { |
105 | 106 | $this->filename = $args['filename']; |
106 | 107 | } |
@@ -71,14 +71,14 @@ |
||
71 | 71 | { |
72 | 72 | // defaults for the local computer |
73 | 73 | $rolesConfig = new BaseObject; |
74 | - $rolesConfig->roles = [ '*' ]; |
|
74 | + $rolesConfig->roles = ['*']; |
|
75 | 75 | |
76 | 76 | $config = &$this->newConfig('localhost')->getConfig(); |
77 | 77 | $config->groups = new BaseObject; |
78 | 78 | $config->groups->{'0'} = new BaseObject; |
79 | 79 | $config->groups->{'0'}->type = "Blackboxes"; |
80 | 80 | $config->groups->{'0'}->details = new BaseObject; |
81 | - $config->groups->{'0'}->details->machines = [ $rolesConfig ]; |
|
81 | + $config->groups->{'0'}->details->machines = [$rolesConfig]; |
|
82 | 82 | |
83 | 83 | // all done |
84 | 84 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | if (!isset($machine->params)) { |
144 | 144 | $machine->params = new BaseObject; |
145 | 145 | } |
146 | - else if (! $machine->params instanceof BaseObject) { |
|
146 | + else if (!$machine->params instanceof BaseObject) { |
|
147 | 147 | $tmp = new BaseObject; |
148 | 148 | $tmp->mergeFrom($machine->params); |
149 | 149 | $machine->params = $tmp; |
@@ -72,16 +72,16 @@ |
||
72 | 72 | // we need a valid PHP class |
73 | 73 | if (!class_exists($value)) |
74 | 74 | { |
75 | - $result->addError(static::MSG_NOTVALIDCLASS); |
|
76 | - return $result; |
|
75 | + $result->addError(static::MSG_NOTVALIDCLASS); |
|
76 | + return $result; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // the class must be a StoryTemplate |
80 | 80 | $refClass = new ReflectionClass($value); |
81 | 81 | if (!$refClass->isSubclassOf('DataSift\Storyplayer\PlayerLib\StoryTemplate')) |
82 | 82 | { |
83 | - $result->addError(static::MSG_NOTVALIDTEMPLATE); |
|
84 | - return $result; |
|
83 | + $result->addError(static::MSG_NOTVALIDTEMPLATE); |
|
84 | + return $result; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | // all done |
@@ -64,22 +64,19 @@ |
||
64 | 64 | |
65 | 65 | public function validate($value, ValidationResult $result = null) |
66 | 66 | { |
67 | - if ($result === null) |
|
68 | - { |
|
67 | + if ($result === null) { |
|
69 | 68 | $result = new ValidationResult($value); |
70 | 69 | } |
71 | 70 | |
72 | 71 | // we need a valid PHP class |
73 | - if (!class_exists($value)) |
|
74 | - { |
|
72 | + if (!class_exists($value)) { |
|
75 | 73 | $result->addError(static::MSG_NOTVALIDCLASS); |
76 | 74 | return $result; |
77 | 75 | } |
78 | 76 | |
79 | 77 | // the class must be a StoryTemplate |
80 | 78 | $refClass = new ReflectionClass($value); |
81 | - if (!$refClass->isSubclassOf('Storyplayer\Stories\StoryTemplate')) |
|
82 | - { |
|
79 | + if (!$refClass->isSubclassOf('Storyplayer\Stories\StoryTemplate')) { |
|
83 | 80 | $result->addError(static::MSG_NOTVALIDTEMPLATE); |
84 | 81 | return $result; |
85 | 82 | } |
@@ -61,14 +61,14 @@ |
||
61 | 61 | // get the hosts table, if we have one |
62 | 62 | $hostsTable = $this->getTable(); |
63 | 63 | if (!$hostsTable) { |
64 | - return; |
|
64 | + return; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | // remove any empty test environments |
68 | 68 | foreach ($hostsTable as $testEnv => $hosts) { |
69 | - if (count(get_object_vars($hosts)) == 0) { |
|
70 | - unset($hostsTable->$testEnv); |
|
71 | - } |
|
69 | + if (count(get_object_vars($hosts)) == 0) { |
|
70 | + unset($hostsTable->$testEnv); |
|
71 | + } |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | // cleanup the tables |
@@ -60,14 +60,14 @@ |
||
60 | 60 | // get the roles table, if we have one |
61 | 61 | $rolesTable = $this->getTable(); |
62 | 62 | if (!$rolesTable) { |
63 | - return; |
|
63 | + return; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // remove any empty test environments |
67 | 67 | foreach ($rolesTable as $testEnv => $roles) { |
68 | - if (count(get_object_vars($roles)) == 0) { |
|
69 | - unset($rolesTable->$testEnv); |
|
70 | - } |
|
68 | + if (count(get_object_vars($roles)) == 0) { |
|
69 | + unset($rolesTable->$testEnv); |
|
70 | + } |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // cleanup the tables |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_InvalidArgument extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct($argumentName, $reason = '', $params = array()) { |
|
60 | + public function __construct($argumentName, $reason = '', $params = array()) |
|
61 | + { |
|
61 | 62 | $msg = "Missing argument '$argumentName'"; |
62 | 63 | if (strlen($reason) > 0) { |
63 | 64 | $msg .= "; reason is '{$reason}'"; |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_MissingArgument extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct($method, $reason = '', $params = array()) { |
|
60 | + public function __construct($method, $reason = '', $params = array()) |
|
61 | + { |
|
61 | 62 | $msg = "Missing argument in '$method'"; |
62 | 63 | if (strlen($reason) > 0) { |
63 | 64 | $msg .= "; reason is '{$reason}'"; |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E4xx_ObsoleteProse extends Exxx_Exception |
59 | 59 | { |
60 | - public function __construct($oldProse, $newProse) { |
|
60 | + public function __construct($oldProse, $newProse) |
|
61 | + { |
|
61 | 62 | $msg = "Support for '$oldProse' has been removed; please use $newProse instead"; |
62 | 63 | parent::__construct(400, $msg, $msg); |
63 | 64 | } |