Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 1d3857d

Browse files
committed
Merge branch 'hotfix/146'
Close #146
2 parents 2de9009 + 1e49d5d commit 1d3857d

18 files changed

+32
-25
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25+
- [#146](https://github.com/zendframework/zend-code/pull/146) updates all `@return` annotations to reflect the correct types returned by each method.
26+
2527
- [#144](https://github.com/zendframework/zend-code/pull/144) fixes the class generator such that it now resolves
2628
`setExtendedClass()` arguments to aliases provided to the generator.
2729

src/Generator/ClassGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ public function addUse($use, $useAlias = null)
743743

744744
/**
745745
* @param string $use
746-
* @return self
746+
* @return bool
747747
*/
748748
public function hasUse($use)
749749
{

src/Generator/DocBlock/Tag/AbstractTypeableTag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($types = [], $description = null)
5050

5151
/**
5252
* @param string $description
53-
* @return ReturnTag
53+
* @return AbstractTypeableTag
5454
*/
5555
public function setDescription($description)
5656
{
@@ -71,7 +71,7 @@ public function getDescription()
7171
* e.g. array('int', 'null') or "int|null"
7272
*
7373
* @param array|string $types
74-
* @return ReturnTag
74+
* @return AbstractTypeableTag
7575
*/
7676
public function setTypes($types)
7777
{

src/Generator/DocBlock/Tag/AuthorTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct($authorName = null, $authorEmail = null)
4242

4343
/**
4444
* @param ReflectionTagInterface $reflectionTag
45-
* @return ReturnTag
45+
* @return AuthorTag
4646
* @deprecated Deprecated in 2.3. Use TagManager::createTagFromReflection() instead
4747
*/
4848
public static function fromReflection(ReflectionTagInterface $reflectionTag)

src/Generator/DocBlock/Tag/ParamTag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct($variableName = null, $types = [], $description = nu
3737

3838
/**
3939
* @param ReflectionTagInterface $reflectionTag
40-
* @return ReturnTag
40+
* @return ParamTag
4141
* @deprecated Deprecated in 2.3. Use TagManager::createTagFromReflection() instead
4242
*/
4343
public static function fromReflection(ReflectionTagInterface $reflectionTag)
@@ -75,7 +75,7 @@ public function getVariableName()
7575

7676
/**
7777
* @param string $datatype
78-
* @return ReturnTag
78+
* @return ParamTag
7979
* @deprecated Deprecated in 2.3. Use setTypes() instead
8080
*/
8181
public function setDatatype($datatype)

src/Generator/DocBlockGenerator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class DocBlockGenerator extends AbstractGenerator
4949
*/
5050
protected $wordwrap = true;
5151

52+
/**
53+
* @var TagManager
54+
*/
5255
protected static $tagManager;
5356

5457
/**
@@ -107,6 +110,9 @@ public static function fromArray(array $array)
107110
return $docBlock;
108111
}
109112

113+
/**
114+
* @return TagManager
115+
*/
110116
protected static function getTagManager()
111117
{
112118
if (! isset(static::$tagManager)) {

src/Reflection/ClassReflection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getDeclaringFile()
5050
/**
5151
* Return the classes DocBlock reflection object
5252
*
53-
* @return DocBlockReflection
53+
* @return DocBlockReflection|false
5454
* @throws Exception\ExceptionInterface for missing DocBock or invalid reflection class
5555
*/
5656
public function getDocBlock()
@@ -70,7 +70,7 @@ public function getDocBlock()
7070

7171
/**
7272
* @param AnnotationManager $annotationManager
73-
* @return AnnotationCollection
73+
* @return AnnotationCollection|false
7474
*/
7575
public function getAnnotations(AnnotationManager $annotationManager)
7676
{
@@ -188,7 +188,7 @@ public function getMethods($filter = -1)
188188
/**
189189
* Returns an array of reflection classes of traits used by this class.
190190
*
191-
* @return void|array
191+
* @return null|array
192192
*/
193193
public function getTraits()
194194
{

src/Reflection/DocBlock/Tag/MethodTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function initialize($tagDocblockLine)
7878
/**
7979
* Get return value type
8080
*
81-
* @return void|string
81+
* @return null|string
8282
* @deprecated 2.0.4 use getTypes instead
8383
*/
8484
public function getReturnType()

src/Reflection/DocBlock/Tag/PropertyTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function initialize($tagDocblockLine)
6464
}
6565

6666
/**
67-
* @return void|string
67+
* @return null|string
6868
* @deprecated 2.0.4 use getTypes instead
6969
*/
7070
public function getType()

src/Reflection/DocBlockReflection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public static function export()
9191
* @param Reflector|string $commentOrReflector
9292
* @param null|DocBlockTagManager $tagManager
9393
* @throws Exception\InvalidArgumentException
94-
* @return DocBlockReflection
9594
*/
9695
public function __construct($commentOrReflector, DocBlockTagManager $tagManager = null)
9796
{

0 commit comments

Comments
 (0)