-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathSyntax.php
More file actions
70 lines (63 loc) · 2.09 KB
/
Syntax.php
File metadata and controls
70 lines (63 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
namespace Thunder\Shortcode\Syntax;
/**
* @author Tomasz Kowalczyk <tomasz@kowalczyk.cc>
*/
final class Syntax implements SyntaxInterface
{
/** @var non-empty-string|null */
private $openingTag;
/** @var non-empty-string|null */
private $closingTag;
/** @var non-empty-string|null */
private $closingTagMarker;
/** @var non-empty-string|null */
private $parameterValueSeparator;
/** @var non-empty-string|null */
private $parameterValueDelimiter;
/**
* @param non-empty-string|null $openingTag
* @param non-empty-string|null $closingTag
* @param non-empty-string|null $closingTagMarker
* @param non-empty-string|null $parameterValueSeparator
* @param non-empty-string|null $parameterValueDelimiter
*/
public function __construct(
$openingTag = null,
$closingTag = null,
$closingTagMarker = null,
$parameterValueSeparator = null,
$parameterValueDelimiter = null
) {
$this->openingTag = $openingTag;
$this->closingTag = $closingTag;
$this->closingTagMarker = $closingTagMarker;
$this->parameterValueSeparator = $parameterValueSeparator;
$this->parameterValueDelimiter = $parameterValueDelimiter;
}
/** @return non-empty-string */
public function getOpeningTag()
{
return null !== $this->openingTag ? $this->openingTag : '[';
}
/** @return non-empty-string */
public function getClosingTag()
{
return null !== $this->closingTag ? $this->closingTag : ']';
}
/** @return non-empty-string */
public function getClosingTagMarker()
{
return null !== $this->closingTagMarker ? $this->closingTagMarker : '/';
}
/** @return non-empty-string */
public function getParameterValueSeparator()
{
return null !== $this->parameterValueSeparator ? $this->parameterValueSeparator : '=';
}
/** @return non-empty-string */
public function getParameterValueDelimiter()
{
return null !== $this->parameterValueDelimiter ? $this->parameterValueDelimiter : '"';
}
}