Skip to content

Commit

Permalink
Allow judge without additional configuration
Browse files Browse the repository at this point in the history
A judge can be configured without additional configuration. Then the additional array-hierarchy is simply null/unset. 

Resolves: #45
  • Loading branch information
neufeind committed May 15, 2023
1 parent 9b1beb4 commit 6e9a83a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Processor/Court.php
Expand Up @@ -156,7 +156,7 @@ protected function addJudgement(array &$judgements, array $configuration, $key,
$fact = (isset($configuration['fact']) && isset($this->facts[$configuration['fact']])) ? $this->facts[$configuration['fact']] : new StaticFactProvider();

if ($fact instanceof AbstractFactProvider) {
$judge = $judge->withConfiguration($this->configuration['judges'][$key . '.'])->adjudicate($fact, (int)$key);
$judge = $judge->withConfiguration($this->configuration['judges'][$key . '.'] ?? [])->adjudicate($fact, (int)$key);

if ($judge->hasDecision() && !isset($decisions[$judge->getDecision()->getPriority()])) {
$decision = $judge->getDecision();
Expand Down

0 comments on commit 6e9a83a

Please sign in to comment.