Compare commits

..
3 Commits
Author SHA1 Message Date
Barry vd. Heuvel 93f9140080 Revert description 2013-05-28 13:32:15 +02:00
Barry vd. Heuvel 824afa2c40 Revert setTypes, getContent and getRawType
So it is just the original, but with setType added.
2013-05-28 13:31:00 +02:00
Barry vd. Heuvel 09f91760eb Add getRawType, setType and setTypes
Also changed getContent to use getType()
2013-05-27 18:04:27 +02:00
26 changed files with 90 additions and 74 deletions
+3 -5
View File
@@ -1,18 +1,16 @@
{
"name": "barryvdh/reflection-docblock",
"name": "phpdocumentor/reflection-docblock",
"type": "library",
"license": "MIT",
"authors": [
{"name": "Mike van Riel", "email": "[email protected]"}
],
"require": {
"php": ">=5.3.3"
},
"suggest": {
"php": ">=5.3.3",
"dflydev/markdown": "1.0.*"
},
"autoload": {
"psr-0": {"Barryvdh": ["src/"]}
"psr-0": {"phpDocumentor": ["src/"]}
},
"require-dev": {
"phpunit/phpunit": "3.7.*@stable"
@@ -10,11 +10,11 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection;
namespace phpDocumentor\Reflection;
use Barryvdh\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Context;
use Barryvdh\Reflection\DocBlock\Location;
use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Context;
use phpDocumentor\Reflection\DocBlock\Location;
/**
* Parses the DocBlock for any structure.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock;
namespace phpDocumentor\Reflection\DocBlock;
/**
* The context in which a DocBlock occurs.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock;
namespace phpDocumentor\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock;
/**
* Parses a Description of a DocBlock or tag.
@@ -209,12 +209,14 @@ class Description implements \Reflector
}
/**
* Returns the long description as a string.
* Returns the exported information (we should use the export static method
* BUT this throws an exception at this point).
*
* @return string
* @codeCoverageIgnore Not yet implemented
*/
public function __toString()
{
return $this->getContents();
return 'Not yet implemented';
}
}
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock;
namespace phpDocumentor\Reflection\DocBlock;
/**
* The location a DocBlock occurs within a file.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock;
namespace phpDocumentor\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock;
/**
* Serializes a DocBlock instance.
@@ -182,7 +182,7 @@ class Serializer
/** @var Tag $tag */
foreach ($docblock->getTags() as $tag) {
$tagText = (string) $tag;
$tagText = "@{$tag->getName()} {$tag->getContent()}";
if ($this->lineLength) {
$tagText = wordwrap($tagText, $wrapLength);
}
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock;
namespace phpDocumentor\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock;
/**
* Parses a tag definition for a DocBlock.
@@ -59,43 +59,43 @@ class Tag implements \Reflector
*/
private static $tagHandlerMappings = array(
'author'
=> '\Barryvdh\Reflection\DocBlock\Tag\AuthorTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag',
'covers'
=> '\Barryvdh\Reflection\DocBlock\Tag\CoversTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag',
'deprecated'
=> '\Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag',
'example'
=> '\Barryvdh\Reflection\DocBlock\Tag\ExampleTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag',
'link'
=> '\Barryvdh\Reflection\DocBlock\Tag\LinkTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag',
'method'
=> '\Barryvdh\Reflection\DocBlock\Tag\MethodTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag',
'param'
=> '\Barryvdh\Reflection\DocBlock\Tag\ParamTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag',
'property-read'
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyReadTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag',
'property'
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag',
'property-write'
=> '\Barryvdh\Reflection\DocBlock\Tag\PropertyWriteTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag',
'return'
=> '\Barryvdh\Reflection\DocBlock\Tag\ReturnTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag',
'see'
=> '\Barryvdh\Reflection\DocBlock\Tag\SeeTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag',
'since'
=> '\Barryvdh\Reflection\DocBlock\Tag\SinceTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag',
'source'
=> '\Barryvdh\Reflection\DocBlock\Tag\SourceTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag',
'throw'
=> '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
'throws'
=> '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
'uses'
=> '\Barryvdh\Reflection\DocBlock\Tag\UsesTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag',
'var'
=> '\Barryvdh\Reflection\DocBlock\Tag\VarTag',
=> '\phpDocumentor\Reflection\DocBlock\Tag\VarTag',
'version'
=> '\Barryvdh\Reflection\DocBlock\Tag\VersionTag'
=> '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag'
);
/**
@@ -366,12 +366,14 @@ class Tag implements \Reflector
}
/**
* Returns the tag as a serialized string
* Returns the exported information (we should use the export static method
* BUT this throws an exception at this point).
*
* @return string
* @codeCoverageIgnore Not yet implemented
*/
public function __toString()
{
return "@{$this->getName()} {$this->getContent()}";
return 'Not yet implemented';
}
}
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for an @author tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @covers tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag\VersionTag;
use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
/**
* Reflection class for a @deprecated tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @example tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @link tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @method in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @param tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @property-read tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @property tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @property-write tag in a Docblock.
@@ -10,10 +10,10 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Type\Collection;
use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Type\Collection;
/**
* Reflection class for a @return tag in a Docblock.
@@ -81,10 +81,24 @@ class ReturnTag extends Tag
return (string) $this->getTypesCollection();
}
/**
* Set the type section of the variable
*
* @param string $type
* @return $this
*/
public function setType($type)
{
$this->type = $type;
$this->types = null;
$this->content = null;
return $this;
}
/**
* Returns the type collection.
*
* @return void
* @return Collection
*/
protected function getTypesCollection()
{
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @see tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag\VersionTag;
use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
/**
* Reflection class for a @since tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @source tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @throws tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @uses tag in a Docblock.
@@ -10,7 +10,7 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @var tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Tag;
namespace phpDocumentor\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tag;
/**
* Reflection class for a @version tag in a Docblock.
@@ -10,9 +10,9 @@
* @link http://phpdoc.org
*/
namespace Barryvdh\Reflection\DocBlock\Type;
namespace phpDocumentor\Reflection\DocBlock\Type;
use Barryvdh\Reflection\DocBlock\Context;
use phpDocumentor\Reflection\DocBlock\Context;
/**
* Collection