addCondition($condition); } } /** * Adds a new condition to the expression. * * @param ConditionInterface $condition the condition to be added * * @return void */ private function addCondition(ConditionInterface $condition) { $this->conditions[] = $condition; } /** * Returns the keyword that the condition represents. */ public function toString(): string { $conditions = \array_map(static function (ConditionInterface $condition): string { return $condition->toString(); }, $this->conditions); return \sprintf('( %s )', \implode(' OR ', $conditions)); } }