Send some data to reporters.

@param string $type The message type.
@param mixed  $data The message data.
772650
public function report($type, $data)
    {
        $suite = $this->suite();
        if ($suite->root()->focused() && !$this->focused()) {
            return;
        }
        $suite->report($type, $data);
    }
727569
public function deleteType($type)
    {
        $contents = $this->contentType->findBy(array('type' => $type));

        foreach ($contents as $content) {
            $this->deleteContent($content->getContent());
        }

        $this->manager->remove($type);
        $this->manager->flush();
    }
732518
protected function checkEnd($type, $data)
    {
        $lastTag = array_pop($this->stack);

        if (!is_array($lastTag)) {
            throw new Exceptions\OutputGeneratorException(
                sprintf(
                    'Invalid close: Trying to close on empty stack.'
                )
            );
        }

        if (array($lastTag[0], $lastTag[1]) !== array($type, $data)) {
            throw new Exceptions\OutputGeneratorException(
                sprintf(
                    'Invalid close: Trying to close %s:%s, while last element was %s:%s.',
                    $type,
                    $data,
                    $lastTag[0],
                    $lastTag[1]
                )
            );
        }
    }
609848
public function setData($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data);
        }

        $this->data = $data;
    }
48233
public function encode(string $data, int $type = Protocol::TYPE_TEXT, bool $masked = false)
    {
        $this->frames = [];

        $frame = $this->getFrame();
        array_push($this->frames, $frame);

        $frame->encode($data, $type, $masked);

        return $this;
    }
6181
public function addMessage($type, $content)
	{
		if($this->session->has('Cfmessage')) {
			$messages = $this->session->get('Cfmessage', []);
		}
		
		$messages[] = [
			'content' => $content,
			'type' => $type,
		];
		
		$this->session->set('Cfmessage', $messages);
	}
1213547
public function sendEmail(EmailType $type)
    {
        $builder = $this->builder;
        $type->buildEmail($builder);
        $email = $builder->build(new SwiftEmail());

        $this->mailer->send($email->getMessage());
    }
702651
public function message($type, $message)
    {
        if ( $this->session->has('flashMessages') ) {
            $flashMessages = $this->session->get('flashMessages');
            $flashMessages[] = ['type' => $type, 'message' => $message];
            $this->session->set('flashMessages', $flashMessages);
        } else {
            $this->session->set('flashMessages', [['type' => $type, 'message' => $message]]);
        }
    }
520565
public function addReference(&$data, $type)
    {
        if (!$this->validate($data)) {
            return false;
        }

        $this->store[$type][] =& $data;
        return $data;
    }
520078
private function createMessageObject(string $type, string $message): Notification
    {
        $msg = new Notification();

        $msg->setType($type);
        $msg->setMessage($message);

        $this->handler->add($msg);

        return $msg;
    }
619671
public function sendDataAsJson($data) {
    $this->disableView();
    $this->setContentType('application/json', 'UTF-8');
    if (is_object($data)) {
      if (method_exists($data,'toArray'))
        $data = $data->toArray();
    }
    if (empty($data))
      $data = new \stdClass();
    
    $this->setJsonContent($data);
    $this->send();
  }
398845
public function log($type = null, $data = [])
    {
        if (!func_num_args()) {
            return $this->_log;
        }
        $this->report($type, $this->log()->add($type, $data));
    }
1289608
public function addMessage($text, $type = null)
    {
        $this->set(null, new \OtherCode\FController\Components\Messages\Message($text, $type));
    }
239637
public function setContent($data, $type = DataFormats::PHP_ARRAY)
    {
        $this->content = $data;

        switch ($type) {
            case DataFormats::PHP_ARRAY:
                $this->contentAsArray = $data;
                $this->contentType = ''; // this could be null, but may cause issues with clients
                break;
            case DataFormats::JSON:
                $this->contentAsArray = json_decode($data, true);
                $this->contentType = DataFormats::toMimeType($type);
                break;
        }

        return $this;
    }
512954
public function info($msg, $data = NULL) {
        if (!$this->isAllowToLog(static::LOG_LEVEL_INFO)) {
            return;
        }

        $this->log('info', $msg, $data);
    }
830855
static function notify( $message, $type )
    {
        $nots = State::get( 'notifications' );
        array_push( $nots, array( 'message' => $message, 'type' => $type ) );
        State::set( 'notifications', $nots );
    }
596730
private function sendTypeData($typeData) {
        switch($typeData) {
            case self::DATA_JSON:
                header(self::CONTENT_TYPE_JSON);
                http_response_code($this->status);
                $this->data = [
                    'message' => 'OK',
                    'data' => $this->data,
                ];
                $this->data = json_encode($this->data);
                break;
            default:
                break;
        }
        
        echo $this->data;
    }