Completed
Push — master ( e0c943...40adb2 )
by Josh
04:05
created

TemplateParser::parseEqualityExpr()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2019 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter\Configurator\Helpers;
9
10
use s9e\TextFormatter\Configurator\Helpers\TemplateParser\Normalizer;
11
use s9e\TextFormatter\Configurator\Helpers\TemplateParser\Optimizer;
12
use s9e\TextFormatter\Configurator\Helpers\TemplateParser\Parser;
13
14
class TemplateParser
15
{
16
	/**
17
	* XSL namespace
18
	*/
19
	const XMLNS_XSL = 'http://www.w3.org/1999/XSL/Transform';
20
21
	/**
22
	* @var string Regexp that matches the names of all void elements
23
	* @link http://www.w3.org/TR/html-markup/syntax.html#void-elements
24
	*/
25
	public static $voidRegexp = '/^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/Di';
26
27
	/**
28
	* Parse a template into an internal representation
29
	*
30
	* @param  string      $template Source template
31
	* @return DOMDocument           Internal representation
32
	*/
33 71
	public static function parse($template)
34
	{
35 71
		$parser = new Parser(new Normalizer(new Optimizer));
36
37 71
		return $parser->parse($template);
38
	}
39
}