mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
@return now trims the content before splitting it;
Removed ThrowTag.php (unnecessary, given the map, which aliases "throw" to ThrowsTag.php); Added tests for ThrowsTag, along with a few other minor test additions and fixes;
This commit is contained in:
@@ -37,7 +37,7 @@ class ReturnTag extends Tag
|
||||
$this->tag = $type;
|
||||
$this->content = $content;
|
||||
|
||||
$content = preg_split('/[\ \t]+/u', $content, 2);
|
||||
$content = preg_split('/[\ \t]+/u', trim($content), 2);
|
||||
|
||||
// any output is considered a type
|
||||
$this->type = array_shift($content);
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* phpDocumentor
|
||||
*
|
||||
* PHP Version 5.3
|
||||
*
|
||||
* @author Mike van Riel <[email protected]>
|
||||
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tag;
|
||||
|
||||
/**
|
||||
* Reflection class for a mistyped @throws tag called @throw in a Docblock.
|
||||
*
|
||||
* This is a very common error, so @throw is aliased to be @throws
|
||||
*
|
||||
* @author Mike van Riel <[email protected]>
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
class ThrowTag extends ThrowsTag
|
||||
{
|
||||
/**
|
||||
* Sets the type to @throws and lets parent parse the tag and populates the
|
||||
* member variables.
|
||||
*
|
||||
* @param string $type Tag identifier for this tag (should be 'throw').
|
||||
* @param string $content Contents for this tag.
|
||||
*/
|
||||
public function __construct($type, $content)
|
||||
{
|
||||
if ('throw' !== $type) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Internal error, ' . __CLASS__ . ' was called with ' . $type
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct('throws', $content);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user