41 throw new InvalidArgumentException(
"The array of conditions can't be empty." );
44 foreach ( $conds as $field => $cond ) {
45 if ( is_numeric( $field ) ) {
47 throw new InvalidArgumentException(
48 __METHOD__ .
": Only IExpression are allowed with numeric key." );
52 if ( $cond instanceof IExpression ) {
53 throw new InvalidArgumentException( __METHOD__ .
": unexpected key $field for IExpression value" );
55 $exprs[] =
new Expression( $field,
'=', $cond );
59 return new static( ...$exprs );