You are here

function XBBCodeTagMatch::__construct in Extensible BBCode 8.2

Same name and namespace in other branches
  1. 8 lib/Drupal/xbbcode/XBBCodeTagMatch.php \Drupal\xbbcode\XBBCodeTagMatch::__construct()
1 method overrides XBBCodeTagMatch::__construct()
XBBCodeRootElement::__construct in src/XBBCodeRootElement.php

File

src/XBBCodeTagMatch.php, line 6

Class

XBBCodeTagMatch

Namespace

Drupal\xbbcode

Code

function __construct(array $regex_set = NULL) {
  if ($regex_set) {
    $this->closing = $regex_set['closing'][0] == '/';
    $this->name = strtolower($regex_set['name'][0]);
    $this->attrs = isset($regex_set['attrs']) ? $this
      ->parseAttrs($regex_set['attrs'][0]) : [];
    $this->option = isset($regex_set['option']) ? $regex_set['option'][0] : NULL;
    $this->element = $regex_set[0][0];
    $this->offset = $regex_set[0][1] + strlen($regex_set[0][0]);
    $this->start = $regex_set[0][1];
    $this->end = $regex_set[0][1] + strlen($regex_set[0][0]);
  }
  else {
    $this->offset = 0;
  }
  $this->content = [];
}