Process <var var="">

@param string[] $attrs

@return void
508587
protected function varStartHandler(array $attrs): void
    {
        if (preg_match('/^I18N::number\((.+)\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::number((int) $match[1]);
        } elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::translate($match[1]);
        } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::translateContext($match[1], $match[2]);
        } else {
            $this->text .= $attrs['var'];
        }
    }
198108
private function setVarStartHandler(array $attrs): void
    {
        if (empty($attrs['name'])) {
            throw new DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
        }

        $name  = $attrs['name'];
        $value = $attrs['value'];
        $match = [];
        // Current GEDCOM record strings
        if ($value === '@ID') {
            if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
                $value = $match[1];
            }
        } elseif ($value === '@fact') {
            $value = $this->fact;
        } elseif ($value === '@desc') {
            $value = $this->desc;
        } elseif ($value === '@generation') {
            $value = (string) $this->generation;
        } elseif (preg_match("/@(\w+)/", $value, $match)) {
            $gmatch = [];
            if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
                $value = str_replace('@', '', trim($gmatch[1]));
            }
        }
        if (preg_match("/\\$(\w+)/", $name, $match)) {
            $name = $this->vars["'" . $match[1] . "'"]['id'];
        }
        $count = preg_match_all("/\\$(\w+)/", $value, $match, PREG_SET_ORDER);
        $i     = 0;
        while ($i < $count) {
            $t     = $this->vars[$match[$i][1]]['id'];
            $value = preg_replace('/\$' . $match[$i][1] . '/', $t, $value, 1);
            $i++;
        }
        if (preg_match('/^I18N::number\((.+)\)$/', $value, $match)) {
            $value = I18N::number((int) $match[1]);
        } elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translate($match[1]);
        } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translateContext($match[1], $match[2]);
        }

        // Arithmetic functions
        if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) {
            // Create an expression language with the functions used by our reports.
            $expression_provider  = new ReportExpressionLanguageProvider();
            $expression_cache     = new NullAdapter();
            $expression_language  = new ExpressionLanguage($expression_cache, [$expression_provider]);

            $value = (string) $expression_language->evaluate($value);
        }

        if (strpos($value, '@') !== false) {
            $value = '';
        }
        $this->vars[$name]['id'] = $value;
    }
788107
protected function _cleanAttrs(array $attrs = array())
    {
        foreach ($attrs as $key => $val) {
            if (Arr::in($key, $this->_disallowAttr)) {
                unset($attrs[$key]);
            }
        }

        return $attrs;
    }
306086
public function setAttribute( $attr, $value ) {
        //value is the text node
        //we add this for the sake of consistency amongst other form elements
        if( strtolower( $attr ) == 'value' ) {
           $this->setText( $value );
        } else {
            parent::setAttribute( $attr, $value );
        }
    }
1068925
protected function _process( array $stmts )
	{
		$this->_msg( 'Changing attribute value type in order domain', 0 );
		$this->_status( '' );

		foreach( $stmts as $table => $stmts )
		{
			$this->_msg( sprintf( 'Checking table "%1$s": ', $table ), 1 );

			if( $this->_schema->tableExists( $table ) === true &&
				$this->_schema->columnExists( $table, 'value' ) === true &&
				$this->_schema->getColumnDetails( $table, 'value' )->getDataType() === 'varchar'
			) {
				foreach( $stmts['index'] as $index => $sql )
				{
					if( $this->_schema->indexExists( $table, $index ) === true ) {
						$this->_execute( $sql );
					}
				}

				$this->_execute( $stmts['column'] );
				$this->_status( 'changed' );
			}
			else
			{
				$this->_status( 'OK' );
			}
		}
	}
738985
public function startElement($name, $attrs)
    {
        $tmp = new ElementHandler($this->parser, $this, $this->configurator, null, null, $this->target);
        $tmp->init($name, $attrs);
    }
178812
public function attrs($attrs) {
		if (is_array($attrs) && !empty($attrs))
			return $this->merge(['query.attrs' => $attrs]);
		else
			return $this->merge(['query.attrs' => func_get_args()]);
	}
357505
public function init($vars) {
		foreach($vars as $n => $v) {
			if($n == 'db') self::$db = $v;
			else if($n == 'error') self::$e = $v;
			else self::$add[$n] = $v;
		}
	}
365912
function addElement($attrs) {
		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
		$this->schemas[$typens][0]->addElement($attrs);
	}
599521
private function footnoteStartHandler(array $attrs): void
    {
        $id = '';
        if (preg_match('/[0-9] (.+) @(.+)@/', $this->gedrec, $match)) {
            $id = $match[2];
        }
        $record = GedcomRecord::getInstance($id, $this->tree);
        if ($record && $record->canShow()) {
            $this->print_data_stack[] = $this->print_data;
            $this->print_data         = true;
            $style                    = '';
            if (!empty($attrs['style'])) {
                $style = $attrs['style'];
            }
            $this->footnote_element = $this->current_element;
            $this->current_element  = $this->report_root->createFootnote($style);
        } else {
            $this->print_data       = false;
            $this->process_footnote = false;
        }
    }
329996
public function process($paths, $absolutePaths, $attributes)
    {
        $url = url();
        $attributesAsText = $this->attributesArrayToText($attributes);

        foreach ($paths as $path)
        {
            print "<link href=\"{$url}{$path}\" {$attributesAsText} rel=\"stylesheet\" type=\"text/css\">" . PHP_EOL;
        }
    }
206747
function _removeAttr($attr, &$attributes)
    {
        $attr = strtolower($attr);
        if (isset($attributes[$attr])) {
            unset($attributes[$attr]);
        }
    }
1015665
private function textStartHandler(array $attrs): void
    {
        $this->print_data_stack[] = $this->print_data;
        $this->print_data         = true;

        // string The name of the Style that should be used to render the text.
        $style = '';
        if (!empty($attrs['style'])) {
            $style = $attrs['style'];
        }

        // string  The color of the text - Keep the black color as default
        $color = '';
        if (!empty($attrs['color'])) {
            $color = $attrs['color'];
        }

        $this->current_element = $this->report_root->createText($style, $color);
    }
605074
public static function script($src, array $attrs = [])
    {
        $attrs = array_merge([
            'src' => $src
        ], $attrs);

        return static::tag('script', null, $attrs);
    }
934159
public function update($vars)
	{
		$this->vars = $vars + $this->vars;

		$this->preprocess($this->vars);
	}
109328
public function remove($attrs)
    {
        !is_array($attrs) && $attrs = array('id' => $attrs);
        
        foreach ($this->members() as $k => $m) {
            foreach ($attrs as $a => $v) {
                if ($m->getAttribute($a) != $v)
                    continue 2;
            }
            unset($this->members[$k]);
        }
        $this->members = array_values($this->members);
        return $this;
    }
607305
public function setAttrs($attrs)
    {
        $oldAttrs = $this->attributes;
        $oldClasses = $this->classes;

        $this->attributes = $attrs;
        $this->attributes = Generator::parseAtts($this);

        $this->attributes = array_merge($oldAttrs, $this->attributes);
        $this->classes = null;
        $this->update('classes');

        if (!empty($oldClasses) && !empty($this->classes)) {
            $this->attributes['class'] = implode(' ', array_merge($oldClasses, $this->classes));
        }
        $this->classes = null;

        if (!empty($oldAttrs['style']) && !empty($this->attributes['style'])) {
            $this->attributes['style'] = Generator::mergeStyles($this->attributes['style'], $oldAttrs['style']);
        }

        $this->update();
    }