Refactored 90% of the library

This commit is contained in:
Mike van Riel
2015-06-12 20:58:56 +02:00
committed by Mike van Riel
parent 58d09836c1
commit 18ef0a8055
80 changed files with 1760 additions and 3847 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2015 Mike van Riel<[email protected]>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Description\Formatter;
use phpDocumentor\Reflection\DocBlock\Description\PassthroughFormatter;
class Description
{
/** @var Tag[]|string[] The contents, as an array of strings and Tag objects */
private $tokens;
/**
* Initializes a this object with a series of tokens of which a description consists.
*
* @param Tag[]|string[] $tokens
*/
public function __construct(array $tokens)
{
$this->tokens = $tokens;
}
/**
* Renders this description as a string where the provided formatter will format tags for the expected output.
*
* @param Formatter|null $formatter
*
* @return string
*/
public function render(Formatter $formatter = null)
{
if ($formatter === null) {
$formatter = new PassthroughFormatter();
}
return $formatter->format($this->tokens);
}
}