Reset messages and build array structure.

@return $this
196309
public function reset()
    {
        $this->messages = [];

        foreach (self::$when as $when) {
            $this->messages[$when] = [];
        }

        return $this;
    }
1176508
private function refresh()
    {
        $this->setHandler($this->config->get('logging.default', 'stack'));

        $this->messages = [
            'handler' => '',
            'files'   => [],
        ];
        $this->files    = [];

        $this->checkHandler();
        $this->checkLogFiles();

        return $this;
    }
726553
public function reset()
    {
        foreach ($this->tasks as $task) {
            curl_multi_remove_handle($this->mh, $task['handle']);
        }

        curl_multi_close($this->mh);

        $this->mh = null;
        $this->tasks = [];

        return $this;
    }
1225201
private function resetMessage()
    {
        $this->subject = '';
        $this->from = [];
        $this->sender = [];
        $this->to = [];
        $this->cc = [];
        $this->bcc = [];
        $this->reply_to = [];
        $this->attachments = [];
        $this->message_layout->setViewLayout('');
        $this->message_layout->setViewTemplate('');
        $this->message_layout->clearVariables();
    }
459155
public function clear()
    {

        $this->getMailer();

        $this->message = Swift_Message::newInstance();
        $this->message->setCharset($this->charset);

        return $this;
    }
921835
public function setMessages($messages)
	{
		if (!is_array($messages))
		{
			throw new InvalidArgumentException(sprintf(
				'Messages must be an array. Type of "%s" passed.',
				gettype($messages)
			));
		}

		$this->_messages = $messages;

		return $this;
	}
227730
public function reset()
    {
        $this->values[self::CODE] = null;
        $this->values[self::MSG] = null;
        $this->values[self::UKEY] = null;
    }
994875
public function reset()
    {
        $this->_passed = null;
        $this->_expectations = [];
        $this->_log = new Log([
            'block' => $this,
            'backtrace' => $this->_backtrace
        ]);
        return $this;
    }
1100350
private function reset()
    {
        $this->default_agent = SmsConfig::getDefaultAgent();
        $this->spare_agents = SmsConfig::getSpareAgents();
        $this->receiver = '';
        $this->sms = null;
        $this->sms_params = [];
    }
1343169
public function reset()
    {
        $this->subject      = null;
        $this->body     = array();
        $this->to           = array();
        $this->cc           = array();
        $this->bcc      = array();
        $this->attachments = array();

        $this->disconnect();

        return $this;
    }
1121591
public function reset()
    {
        $this->links = [];
        $this->breadcrumbClass = 'breadcrumbs';
        $this->containerTag = 'ul';
        $this->itemTag = 'li';

        return $this;
    }
159858
protected function reset()
    {
        $this->scriptName      = null;
        $this->commandName     = null;
        $this->options         = [];
        $this->arguments       = [];

        return $this;
    }
823161
public function reset()
    {
        $this->_to = [];
        $this->_from = [];
        $this->_sender = [];
        $this->_replyTo = [];
        $this->_readReceipt = [];
        $this->_returnPath = [];
        $this->_cc = [];
        $this->_bcc = [];
        $this->_messageId = true;
        $this->_subject = '';
        $this->_headers = [];
        $this->_textMessage = '';
        $this->_htmlMessage = '';
        $this->_message = [];
        $this->_emailFormat = 'text';
        $this->_transport = null;
        $this->_priority = null;
        $this->charset = 'utf-8';
        $this->headerCharset = null;
        $this->transferEncoding = null;
        $this->_attachments = [];
        $this->_profile = [];
        $this->_emailPattern = self::EMAIL_PATTERN;

        $this->viewBuilder()->setLayout('default');
        $this->viewBuilder()->setTemplate('');
        $this->viewBuilder()->setClassName('Cake\View\View');
        $this->viewVars = [];
        $this->viewBuilder()->setTheme(false);
        $this->viewBuilder()->setHelpers(['Html'], false);

        return $this;
    }
112706
public function reset()
    {
        $this->_data     = array();
        $this->_modified = array();

        if ($this->isConnected()) {
            $this->_data = $this->getTable()->getDefaults();
        }

        return $this;
    }
1295745
public function reset()
    {
        $args = func_get_args();
        extract(self::parseArgs($args));
        if ($this->weight !== $weight) {
            $this->weight($weight);
        }
        if ($this->backup !== $backup) {
            $this->backup($backup);
        }
        if (is_callable($work) && $this->work !== $work) {
            $this->work($work);
        }

        return $this;
    }
138643
public function reset()
    {
        return $this->collector->set($this->method, $this->pattern, $this->action)->nth(0)
                               ->setStrategy($this->strategy)->setParams($this->params)
                               ->setDefaults($this->defaults)->setMetadataArray($this->metadata);
    }
1064683
public function clear()
    {
        $keys = array_keys($this->values);
        foreach ($keys as $key)
            unset($this->values[$key]);
        return $this;
    }