Returns any notices.

@param array $messages
509264
public function quiz_notices($messages) {
        if (!$messages) {
            return '';
        }
        return $this->box($this->heading(get_string('accessnoticesheader', 'quiz'), 3) .
                $this->access_messages($messages), 'quizaccessnotices');
    }
869416
private static function generateAlert($messages){
        $html = '';
        foreach($messages as $message) {
            $c = $message['cat']=='error'?'danger':$message['cat'];
            $t = $message['title'];
            $m = $message['message'];

            $html.=<<<HTML
<div class="row">
                <div class="col-lg-12">
                    <div class="alert alert-$c alert-dismissable">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
HTML;
                        $icon = 'fa-info-circle';
                        if($c == 'warning')
                            $icon = 'fa-warning';
                        elseif($c == 'danger')
                            $icon = 'fa-times-circle';
                        elseif($c == 'success')
                            $icon = 'fa-check';
$html.=<<<HTML
                        <i class="fa $icon "></i>
                        <strong>$t</strong><br>
                        $m
                    </div>
                </div>
            </div>
            <!-- /.row -->
HTML;
        }
        return $html;
    }
212328
public static function notice($message, array $extras = [])
    {
        if (self::$logger) {
            self::$logger->notice($message, $extras);
        }
    }
1199025
public function getNotifierForMessage(Message $message): Notifier
    {
        foreach ($this->notifiers as $notifier) {
            if ($notifier->handles($message)) {
                return $notifier;
            }
        }
        throw new NotifierNotFoundException();
    }
1297470
private function recordFilter(array $records)
    {
        $messages = [];
        foreach ($records as $record) {
            if (!isset($record['level'])) {
                continue;
            }
            if (!$this->isHandling($record)) {
                continue;
            }

            $record = $this->processRecord($record);
            $record['formatted'] = $this->getFormatter()->format($record);

            $messages[] = $record;
        }
        return $messages;
    }
588951
public static function check($emails): array
    {
        $result = [];

        if (empty($emails)) {
            return $result;
        }

        $emails = self::handleEmailsInput($emails);

        foreach ($emails as $email) {
            if (!self::isValid($email)) {
                continue;
            }
            if (!in_array($email, $result, true)) {
                $result[] = $email;
            }
        }

        return $result;
    }
82671
public function getMessages($flush = true)
    {
        $result = $this->_messages;

        if($flush) {
            $this->_messages = array();
        }

        return $result;
    }
461121
public function precheck_notices($results) {
        $output = html_writer::start_tag('div', array('class' => 'restore-precheck-notices'));
        if (array_key_exists('errors', $results)) {
            foreach ($results['errors'] as $error) {
                $output .= $this->output->notification($error);
            }
        }
        if (array_key_exists('warnings', $results)) {
            foreach ($results['warnings'] as $warning) {
                $output .= $this->output->notification($warning, 'notifyproblem');
            }
        }
        return $output.html_writer::end_tag('div');
    }
1112847
protected function denormaliseMessages($messages)
    {
        // Sort prior to denormalisation
        ksort($messages);
        $entities = [];
        foreach ($messages as $entity => $value) {
            // Skip un-namespaced keys
            $value = $this->denormaliseValue($value);

            // Non-nested key
            if (strstr($entity, '.') === false) {
                $entities[$entity] = $value;
                continue;
            }

            // Get key nested within class
            list($class, $key) = $this->getClassKey($entity);
            if (!isset($entities[$class])) {
                $entities[$class] = [];
            }

            $entities[$class][$key] = $value;
        }
        return $entities;
    }
1335695
public static function withMessages(array $messages)
    {
        return new static(tap(ValidatorFacade::make([], []), function ($validator) use ($messages) {
            foreach ($messages as $key => $value) {
                foreach (Arr::wrap($value) as $message) {
                    $validator->errors()->add($key, $message);
                }
            }
        }));
    }
1211879
protected function findNextMessages($types)
    {
        return $this->messageManager->findByAttempts(
            $this->types,
            MessageInterface::STATE_ERROR,
            $this->batchSize,
            $this->maxAttempts,
            $this->attemptDelay
        );
    }
451604
protected function success($messages = null)
	{
		$data = $this->getStatusData('success', $messages);
		return $this->jsonResponse($data, 200);
	}
956019
public function setMessages(array $messages)
    {
        $this->unsetMessages();
        foreach ($messages as $message) {
            $this->appendMessage($message);
        }

        return $this;
    }
881550
public function log($messages)
    {
        if (!is_array($messages)) {
            $messages = [$messages];
        }
        foreach ($messages as $message) {
            file_put_contents($this->logFile, date('d.m.Y H:i:s') . ' - ' . $message . PHP_EOL, FILE_APPEND | LOCK_EX);
        }
    }
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;
	}
17005
public static function get ($status = FALSE)
	{
		
		// If no status return all messages
		
		if ($status === FALSE)
		{
			return self::$messages;
		}
		
		// Return messages for a specific status
		
		if (isset (self::$messages[$status]))
		{
			return self::$messages[$status];
		}
		else
		{
			return array ();
		}
		
	}
127521
public function extractNotificationsFromRows(array $rows): array
    {
        $notifications = [];
        foreach ($rows as $row) {
            $notifications[] = $this->extractNotificationFromRow($row);
        }

        return $notifications;
    }