Unverified Commit 91bbb61c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3065586 by Charlie ChX Negyesi, alexpott: ConditionManager::execute()...

Issue #3065586 by Charlie ChX Negyesi, alexpott: ConditionManager::execute() implementation doesn't conform to the interface
parent 7daf1e69
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

use Drupal\Component\Plugin\CategorizingPluginManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Executable\ExecutableException;
use Drupal\Core\Executable\ExecutableManagerInterface;
use Drupal\Core\Executable\ExecutableInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -71,8 +72,11 @@ public function createInstance($plugin_id, array $configuration = []) {
   * {@inheritdoc}
   */
  public function execute(ExecutableInterface $condition) {
    if ($condition instanceof ConditionInterface) {
      $result = $condition->evaluate();
      return $condition->isNegated() ? !$result : $result;
    }
    throw new ExecutableException("This manager object can only execute condition plugins");
  }

}