You are here

protected function PrintEngineException::evalulateRegex in Entity Print 8.2

Evaluates our patterns against the subject.

Parameters

array $patterns: An array of regular expressions to check.

string $subject: The subject to check against.

Return value

bool TRUE if anyone of the patterns match otherwise FALSE.

1 call to PrintEngineException::evalulateRegex()
PrintEngineException::isAuthFailure in src/PrintEngineException.php
Check if this message looks like an authorisation failure.

File

src/PrintEngineException.php, line 86

Class

PrintEngineException
The exception thrown when a implementation fails to generate a document.

Namespace

Drupal\entity_print

Code

protected function evalulateRegex(array $patterns, $subject) {
  foreach ($patterns as $pattern) {
    if (preg_match($pattern, $subject, $matches)) {
      return TRUE;
    }
  }
  return FALSE;
}