diff --git a/src/Engine/ExpressionManager.php b/src/Engine/ExpressionManager.php index 9f25e2e2..a2c47266 100644 --- a/src/Engine/ExpressionManager.php +++ b/src/Engine/ExpressionManager.php @@ -50,6 +50,9 @@ public function createReactionRule(array $configuration = []) { * {@inheritdoc} */ public function createAction($id) { + if (!is_string($id)) { + throw new \InvalidArgumentException(t('Rules Action IDs must be strings.')); + } return $this->createInstance('rules_action', [ 'action_id' => $id, ]); @@ -59,6 +62,9 @@ public function createAction($id) { * {@inheritdoc} */ public function createCondition($id) { + if (!is_string($id)) { + throw new \InvalidArgumentException(t('Condition IDs must be strings.')); + } return $this->createInstance('rules_condition', [ 'condition_id' => $id, ]);