Made the Tag::createInstance() create generic tag objects when there are uppercase letters in the tag name

(this fixes phpDocumentor/phpDocumentor2#672).
This commit is contained in:
Vasil Rangelov
2012-11-10 14:00:01 +02:00
parent 19a9124274
commit ca90350e36
2 changed files with 42 additions and 2 deletions
@@ -68,7 +68,8 @@ class Tag implements \Reflector
).'Tag';
$class_name = 'phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name;
return (@class_exists($class_name))
return ($matches[1] === strtolower($matches[1])
&& @class_exists($class_name))
? new $class_name($matches[1], isset($matches[2]) ? $matches[2] : '')
: new self($matches[1], isset($matches[2]) ? $matches[2] : '');
}