/** * Verifies this is an array with keys 0 and 1, where key 0 is a usable * operator (initially just '=') and key 1 is something that can be cast to a string * * @param array $op_and_value * @return array * @throws \EE_Error */ protected function _validate_op_and_value($op_and_value) { if (!isset($op_and_value[0], $op_and_value[1])) { EE_Error::throw_exception_if_debugging(sprintf(__('Required Validation Strategy conditions array\'s value must be an array with two elements: an operator, and a value. It didn\'t. The related input is %1$s', 'event_espresso'), $this->_input->name()), __FILE__, __FUNCTION__, __LINE__); } $operator = $op_and_value[0]; $value = (string) $op_and_value[1]; if ($operator !== '=') { EE_Error::throw_exception_if_debugging(sprintf(__('Required Validation Strategy conditions can currently only use the equals operator. If you need others, please add support for it! The related input is %1$s', 'event_espresso'), $this->_input->name()), __FILE__, __FUNCTION__, __LINE__); } return array($operator, $value); }