Slight cleanup to please PHPMD.

This commit is contained in:
Dan Cryer 2015-02-20 14:24:37 +00:00
parent 35a6d1f577
commit 071e36a4e9

View file

@ -48,27 +48,20 @@ class Executor
foreach ($config[$stage] as $plugin => $options) { foreach ($config[$stage] as $plugin => $options) {
$this->logger->log(Lang::get('running_plugin', $plugin)); $this->logger->log(Lang::get('running_plugin', $plugin));
// Is this plugin allowed to fail?
if ($stage == 'test' && !isset($options['allow_failures'])) {
$options['allow_failures'] = false;
}
// Try and execute it: // Try and execute it:
if ($this->executePlugin($plugin, $options)) { if ($this->executePlugin($plugin, $options)) {
// Execution was successful: // Execution was successful:
$this->logger->logSuccess(Lang::get('plugin_success')); $this->logger->logSuccess(Lang::get('plugin_success'));
} else { } elseif ($stage == 'setup') {
// If we're in the "setup" stage, execution should not continue after // If we're in the "setup" stage, execution should not continue after
// a plugin has failed: // a plugin has failed:
if ($stage == 'setup') { throw new \Exception('Plugin failed: ' . $plugin);
throw new \Exception('Plugin failed: ' . $plugin); } else {
}
// If we're in the "test" stage and the plugin is not allowed to fail, // If we're in the "test" stage and the plugin is not allowed to fail,
// then mark the build as failed: // then mark the build as failed:
if ($stage == 'test' && !$options['allow_failures']) { if ($stage == 'test' && (!isset($options['allow_failures']) || !$options['allow_failures'])) {
$success = false; $success = false;
} }