private const NO_NAME = '%s Error: a tag MUST have a name';
25
26
2
public function __construct(string $tagName, $value)
27
{
28
2
if (empty($tagName)) {
29
1
throw new \Exception(sprintf(self::NO_NAME, __METHOD__));
30
}
31
2
$this->tagName = $tagName;
32
2
$this->value = $value;
33
2
}
34
35
/**
36
* Should verify if the tag is correct
37
*
38
* @param string $providedName The provided name
39
* @todo is this required ???
40
*/
41
// private function checkNameValidity(string $providedName)
42
// {
43
/* TODO implement and throw Exception if invalid (setName method ???)
44
*The suffix must not contain any “!” character. This would cause the tag shorthand to be interpreted as having a named tag handle. In addition, the suffix must not contain the “[”, “]”, “{”, “}” and “,” characters. These characters would cause ambiguity with flow collection structures. If the suffix needs to specify any of the above restricted characters, they must be escaped using the “%” character. This behavior is consistent with the URI character escaping rules (specifically, section 2.3 of RFC2396).