original_string: public function setData($data)
      {
          if (!is_array($data) && !is_object($data)) {
              throw new \InvalidArgumentException(sprintf(
                  'Expected argument of type array or object, "%s" given',
                  is_object($data) ? get_class($data) : gettype($data)
              ));
          }
          $this->data = $data;
          return $this;
      }
code: public function setData($data)
      {
          if (!is_array($data) && !is_object($data)) {
              throw new \InvalidArgumentException(sprintf(
                  'Expected argument of type array or object, "%s" given',
                  is_object($data) ? get_class($data) : gettype($data)
              ));
          }
          $this->data = $data;
          return $this;
      }
code_tokens: public function setData ( $ data ) { if ( ! is_array ( $ data ) && ! is_object ( $ data ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Expected argument of type array or object, "%s" given' , is_object ( $ data ) ? get_class ( $ data ) : gettype ( $ data ) ) ) ; } $ this -> data = $ data ; return $ this ; }
docstring: Sets data for validation
  
  @param array|object $data
  @throws \InvalidArgumentException when argument type is not array or object
  @return $this
docstring_tokens: Sets data for validation