Adds an expectation report and emits a report event.

@param array $data The report data.
18297
public function add($type, $data = [])
    {
        if ($this->type() === 'passed' && $type === 'failed') {
            $this->type('failed');
        }
        $data['type'] = $type;
        if (!isset($data['backtrace'])) {
            $data['backtrace'] = [];
        } else {
            $data['backtrace'] = Debugger::focus($this->block()->suite()->backtraceFocus(), $data['backtrace'], 1);
        }
        $child = new static($data + ['block' => $this->_block]);
        $this->_children[] = $child;
        return $child;
    }
534523
public function exchangeArray(array $data)
	{
		$this->setProjectId(isset($data['ProjectId']) ? $data['ProjectId'] : null);
		$this->setName(isset($data['Name']) ? $data['Name'] : null);
		$this->setDescription(isset($data['Description']) ? $data['Description'] : null);
		$this->setCreated(isset($data['Created']) ? $data['Created'] : null);
	}
1047551
public function failed(array $data)
    {
        $command = unserialize($data['command']);

        if (method_exists($command, 'failed')) {
            $command->failed($e);
        }
    }
453646
private function _handleInvoiceCreated(array $data)
    {
        $stripeInvoice = $data['data']['object'];

        if ($this->hasEventHandlers(self::EVENT_CREATE_INVOICE)) {
            $this->trigger(self::EVENT_CREATE_INVOICE, new CreateInvoiceEvent([
                'invoiceData' => $stripeInvoice
            ]));
        }

        $canBePaid = empty($stripeInvoice['paid']) && $stripeInvoice['billing'] === 'charge_automatically';

        if (StripePlugin::getInstance()->getSettings()->chargeInvoicesImmediately && $canBePaid) {
            /** @var StripeInvoice $invoice */
            $invoice = StripeInvoice::retrieve($stripeInvoice['id']);
            $invoice->pay();
        }
    }
202518
public function emit($event, Array $payload)
	{
		$m = $this->bareMessage(static::MESSAGE_TYPE_STANDARD);
		$m->Event = $event;
		$m->Payload = $payload;

		$this->send($m);
	}
591796
protected function prepareDataForNewRecord(array &$data)
    {
        if ($this->testingFramework === null) {
            return;
        }

        $tableName = $this->getTableName();
        $this->testingFramework->markTableAsDirty($tableName);
        $data[$this->testingFramework->getDummyColumnName($tableName)] = 1;
    }
437957
public function setFromArray(array $data): void
	{
		foreach ($data as $parameter => $value) {
			$this->bindings[$parameter] = new Bind($parameter, $value);
		}
	}
776609
public function populate($data = array())
    {
        parent::populate($data);

        if (isset($data['scheduleOccurrenceAuto']) && $data['scheduleOccurrenceAuto'] !== null) {
            $this->scheduleOccurrenceAuto = $data['scheduleOccurrenceAuto'];
        }

        if (isset($data['occurrenceNumber']) && $data['occurrenceNumber'] !== null) {
            $this->occurrenceNumber = $data['occurrenceNumber'];
        }

        if (isset($data['winningOccurrenceNumber']) && $data['winningOccurrenceNumber'] !== null) {
            $this->occurrenceNumber = $data['winningOccurrenceNumber'];
        }

        if (isset($data['occurrenceType']) && $data['occurrenceType'] !== null) {
            $this->occurrenceType = $data['occurrenceType'];
        }
    }
1052575
protected function createViewEvent(array $data)
    {
        $result = new WxReceiveViewEvent();
        $this->initReceive($result, $data);

        $result->setEventKey($data['EventKey']);

        return $result;
    }
846293
protected function outputStrategy(array &$data)
    {
        $xmlData = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><resource></resource>');
        $this->arrayToXml($data, $xmlData);
        if (!empty($data[JsonTransformer::LINKS_KEY][JsonTransformer::LINK_SELF][JsonTransformer::LINKS_HREF])) {
            $xmlData->addAttribute(
                JsonTransformer::LINKS_HREF,
                $data[JsonTransformer::LINKS_KEY][JsonTransformer::LINK_SELF][JsonTransformer::LINKS_HREF]
            );
        }

        $xml = $xmlData->asXML();
        $xmlDoc = new DOMDocument();
        $xmlDoc->loadXML($xml);
        $xmlDoc->preserveWhiteSpace = false;
        $xmlDoc->formatOutput = true;
        $xmlDoc->substituteEntities = false;

        return rtrim(html_entity_decode($xmlDoc->saveXML()), "\n");
    }
1054274
private function log($data)
    {
        $data = date(DATE_RSS, time()) . "\t$data\n";
        file_put_contents($this->storage('.log'), $data, FILE_APPEND);
    }
322229
private function addDocumentsFromArray(array $data)
    {
        $_documentClass = $this->_documentClass;

        $this->_result[] = $_documentClass::createFromArray($data, $this->_options);
    }
228045
private function notifyGuzzle5(array $data)
    {
        $response = $this->guzzle->post($this->getNotificationEndpoint(), $data);

        $this->logger->debug(sprintf('Got %s from Recommendation Service notification POST (guzzle v5)', $response->getStatusCode()));
    }
494244
public function addRaw($data)
	{
		$this->validateData($data);

		$data['location'] = trim($data['location'], '/');

		$this->entries[] = $this->replaceAttributes($data);
	}
993329
public function init(array $data = [])
    {
        foreach ($data as $key => $value) {
            $this->set($key, $value);
        }
    }
1101996
public function insert(array $data) {
        $this->notifyObservers('beforeInsert', array($this, &$data));
        $pkData = parent::insert($data);
        $this->notifyObservers('afterInsert', array($this, $data, $pkData));
        return $pkData;
    }
239811
protected function display($data = [])
    {
        // eg onScript
        $function = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];
        $event = lcfirst(substr($function, 2));
        $id = $this->getId();

        // eg @plugin/plugin/script.php
        $name = '@' . $id . '/' . $id . '/' . $event . $this->view->getExtension();

        $this->view->display($name, $data);
    }