public function addTag(string $tagName, string $src)
    {
        if (preg_match('/^[a-z\-]+$/', $tagName) !== 1) {
            throw new \InvalidArgumentException('The tag name provided is not valid! It may contain letters (a-z) and dashes (-).');
        }
        $this->tags[strtolower(trim($tagName))] = $src;
    }
public function addTag(string $tagName, string $src)
    {
        if (preg_match('/^[a-z\-]+$/', $tagName) !== 1) {
            throw new \InvalidArgumentException('The tag name provided is not valid! It may contain letters (a-z) and dashes (-).');
        }
        $this->tags[strtolower(trim($tagName))] = $src;
    }
public function addTag ( string $ tagName , string $ src ) { if ( preg_match ( '/^[a-z\-]+$/' , $ tagName ) !== 1 ) { throw new \ InvalidArgumentException ( 'The tag name provided is not valid! It may contain letters (a-z) and dashes (-).' ) ; } $ this -> tags [ strtolower ( trim ( $ tagName ) ) ] = $ src ; }
Defines a new tag.

@param string $tagName The tag name.
@param string $src The tag source.
@return void No value is returned.
@throws \InvalidArgumentException
Defines a new tag .