original_string: public function required($options) {
          if ((is_array($options) || (!is_array($options) && $options))) {
              if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) ||
                      (!is_array($this->elementData) && trim($this->elementData) === '')) {
                  if (is_bool($options))
                      $this->addError('Field is required');
                  else if (is_array($options) && isset($options['message'])) {
                      $this->addError($options['message']);
                  } else
                      $this->addError((!is_array($options) && !is_object($options)) ? $options : 'Field is required');
                  return false;
              }
              return true;
          }
          return true;
      }
code: public function required($options) {
          if ((is_array($options) || (!is_array($options) && $options))) {
              if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) ||
                      (!is_array($this->elementData) && trim($this->elementData) === '')) {
                  if (is_bool($options))
                      $this->addError('Field is required');
                  else if (is_array($options) && isset($options['message'])) {
                      $this->addError($options['message']);
                  } else
                      $this->addError((!is_array($options) && !is_object($options)) ? $options : 'Field is required');
                  return false;
              }
              return true;
          }
          return true;
      }
code_tokens: public function required ( $ options ) { if ( ( is_array ( $ options ) || ( ! is_array ( $ options ) && $ options ) ) ) { if ( ( is_array ( $ this -> elementData ) && ( empty ( $ this -> elementData ) || ( empty ( $ this -> elementData [ 0 ] ) && count ( $ this -> elementData ) === 1 ) ) ) || ( ! is_array ( $ this -> elementData ) && trim ( $ this -> elementData ) === '' ) ) { if ( is_bool ( $ options ) ) $ this -> addError ( 'Field is required' ) ; else if ( is_array ( $ options ) && isset ( $ options [ 'message' ] ) ) { $ this -> addError ( $ options [ 'message' ] ) ; } else $ this -> addError ( ( ! is_array ( $ options ) && ! is_object ( $ options ) ) ? $ options : 'Field is required' ) ; return false ; } return true ; } return true ; }
docstring: Makes an element required
  @param string $name Name of the element to filter
  @param boolean|string|array $options Boolean indicates required or not.
  String indicates required with custom message.
  Array indicates required and has options
  @return boolean
docstring_tokens: Makes an element required