/**
  * @param Rule          $rule
  * @param WorkingMemory $workingMemory
  *
  * @return array
  */
 public function execute(Rule $rule, WorkingMemory $workingMemory)
 {
     $facts = $workingMemory->getAllFacts();
     /**
      * @param string $_action
      * @return array
      */
     $executor = function ($_action) use($facts) {
         extract($facts);
         unset($facts);
         eval($_action);
         unset($_action);
         return get_defined_vars();
     };
     $workingMemory->setAllFacts($executor($rule->getAction()));
     $workingMemory->setExecuted($rule->getRule());
 }
 /**
  * @param Rule          $rule
  * @param WorkingMemory $workingMemory
  *
  * @return array
  */
 public function execute(Rule $rule, WorkingMemory $workingMemory)
 {
     if ($rule instanceof RuleRunDecorator && $rule->hasSuccessCombinationRules()) {
         $workingMemory->setExecuted($rule->getRule());
         foreach ($rule->getSuccessCombinationRules() as $combinationRule) {
             $this->inferenceProfiler && $this->inferenceProfiler->addIterationRuleExecution($combinationRule);
             $workingMemory->setAllFacts($this->execAction($combinationRule, $workingMemory));
             $workingMemory->setExecuted($combinationRule);
         }
     } else {
         $this->inferenceProfiler && $this->inferenceProfiler->addIterationRuleExecution($rule);
         $workingMemory->setAllFacts($this->execAction($rule, $workingMemory));
         $workingMemory->setExecuted($rule->getRule());
     }
 }