Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Configurability/ConfigurableServiceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConfigurableServiceHelper
const CONF_MESSAGE = 'message';
const CONF_RECOVERABLE = 'recoverable';

const CONF_NO_RESULTS = 'noResults';
const CONF_NO_RESULTS = 'no_results';
const STEP_DEFINE = 'define';

const STEP_VALIDATE = 'validate';
Expand Down Expand Up @@ -96,11 +96,13 @@ public function createContext(array $options, MessageInterface $message = null,
return $context;
}

public function resolveArray($input, &$context){
public function resolveArray($input, &$context)
{
$output = [];
foreach($input as $key => $value){
$output[$key] = $this->resolve($value,$context);
foreach ($input as $key => $value) {
$output[$key] = $this->resolve($value, $context);
}

return $output;
}

Expand Down Expand Up @@ -163,6 +165,7 @@ public function executeStep($stepAction, &$stepActionParams, &$options, array &$
break;
case self::STEP_VALIDATE:
$this->validate($stepActionParams, $context);

return true;
break;
default:
Expand Down Expand Up @@ -196,7 +199,6 @@ public function define(array $definitions, array &$context)

public function validate(array $stepConfig, array &$context)
{

$config = $this->validateResolver->resolve($stepConfig);

$rule = $config[self::CONF_RULE];
Expand All @@ -206,7 +208,7 @@ public function validate(array $stepConfig, array &$context)
$display_message = $config[self::CONF_DISPLAY_MESSAGE];

$evaluation = $this->resolve($rule, $context);
if ($evaluation !== true) {
if (true !== $evaluation) {
$message = $this->resolve($message, $context);
if ($no_results) {
throw new NoResultsException($message);
Expand Down