Fill the inner messages buffer.

@param array $types
183508
protected function bufferize($types = [])
    {
        while (true) {
            $this->buffer = $this->findNextMessages($types);

            if (\count($this->buffer) > 0) {
                break;
            }

            usleep($this->pause);
        }
    }
51034
public function setMessage($type, $message) {
		if (!$this->session->has('flashmsgs')) {
			$this->session->set('flashmsgs', array());
		}
		$temp = $this->session->get('flashmsgs');
		$temp[] = array('type' => $type, 'content' => $message);
		$this->session->set('flashmsgs', $temp);
	}
1038603
protected function write($messages): void
    {
        if (! \is_array($messages)) {
            $messages = [$messages];
        }

        foreach ($messages as $i => $message) {
            $messages[$i] = '    - ' . $message;
        }

        $this->io->writeError($messages, true, IOInterface::VERBOSE);
    }
285748
public function add($message, $type)
    {
        $this->messages[$type][] = $message;

        $this->getSessionBag()->set($type, $this->messages[$type]);
    }
1211879
protected function findNextMessages($types)
    {
        return $this->messageManager->findByAttempts(
            $this->types,
            MessageInterface::STATE_ERROR,
            $this->batchSize,
            $this->maxAttempts,
            $this->attemptDelay
        );
    }
1309244
public function addMessage($message, $type) {
		if (isset($_SESSION[$this->sessionKey]))
		{
			$messages = $_SESSION[$this->sessionKey];
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$_SESSION[$this->sessionKey] = $messages;
	}
1170154
public function argTypes($types) {
		is_array($types) ? $this->argumentTypes = $types : $this->argumentTypes = func_get_args();
		return $this;
	}
276915
private function save(array $messages)
    {
        fseek($this->fh, 0);
        fwrite($this->fh, json_encode($messages));
    }
696620
public function setMessage($message, $type = 'info', $key = 'messages')
    {
        if ($message !== '') {

            $messages = (array) $this->get("$key.$type", array());

            if (!in_array($message, $messages)) {
                $messages[] = $message;
                $this->set("$key.$type", $messages);
            }
        }
    }
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;
	}
397910
public function fill(array $values)
	{
		foreach ($values as $key => $value)
		{
			callback($this, 'fill' . ucfirst($key))->invoke($value);
		}
		return $this;
	}
660434
public function setAutowiringTypes(array $types)
    {
        $this->autowiringTypes = array();

        foreach ($types as $type) {
            $this->autowiringTypes[$type] = true;
        }

        return $this;
    }
706596
public function preload($beans, $types) {
		foreach($types as $key => $type) {
			$map = array();
			$field = (is_numeric($key)) ? $type : $key;
			$ids = array();
			foreach($beans as $bean) {
				if($id = $bean->{$field.'_id'}){
					$ids[$id] = $id;
					if (!isset($map[$id])) $map[$id] = array();
					$map[$id][] = $bean;
				}
			}
			$parents = $this->batch($type,$ids);
			foreach($parents as $parent) {
				foreach($map[$parent->id] as $childBean) {
					$childBean->setProperty($field,$parent);
				}
			}
		}
	}
251652
public static function sql(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('sql')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::SQL)) {
                    $adapter->sql((new Message(self::SQL))->setMessages($messages));
                }
            }
        }
    }
342924
protected function printMessages(string $type, array $messages = []) : void
    {
        $this->out('');

        $plural = Inflector::pluralize($type);
        if (empty($messages)) {
            $this->success("No $plural found in module.");

            return;
        }

        // Minimize output to only unique messages
        $messages = array_unique($messages);

        $plural = ucfirst($plural);
        $this->{$type}("$plural (" . count($messages) . "):");

        // Remove ROOT path for shorter output
        $messages = preg_replace('#' . ROOT . DS . '#', '', $messages);
        if (null === $messages) {
            return;
        }

        // Prefix all messages as list items
        $messages = preg_replace('/^/', ' - ', $messages);
        if (null === $messages) {
            return;
        }

        $this->{$type}($messages);
    }
1006603
public function lookUp(array $types)
    {
        while ($this->hasTokens()) {
            $token = $this->getToken();
            if (!in_array(get_class($token), $types, true)) {
                break;
            }

            yield $token;

            $this->nextToken();
        }
    }
1044179
public function flush($type) {
		if (isset($this->cache[$type])) $this->cache[$type]=array();
		return $this;
	}