File tree Expand file tree Collapse file tree 6 files changed +15
-8
lines changed
src/phpDocumentor/Reflection Expand file tree Collapse file tree 6 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<phive xmlns =" https://phar.io/phive" >
3
- <phar name =" phpstan" version =" ^0.9.1" installed =" 0.10.7 " location =" ./tools/phpstan" copy =" true" />
3
+ <phar name =" phpstan" version =" ^0.9.1" installed =" 0.11.4 " location =" ./tools/phpstan" copy =" true" />
4
4
<phar name =" phpunit" version =" ^7.0" installed =" 7.5.7" location =" ./tools/phpunit" copy =" true" />
5
5
<phar name =" phpbench" version =" ^0.16.9" installed =" 0.16.9" location =" ./tools/phpbench" copy =" true" />
6
6
</phive >
Original file line number Diff line number Diff line change @@ -2,10 +2,14 @@ parameters:
2
2
ignoreErrors :
3
3
4
4
- '#Method phpDocumentor\\Reflection\\File\\LocalFile::\md5\ (\ ) should return string but returns string\|false\. #'
5
+ - ' #Else branch is unreachable because ternary operator condition is always true\. #'
6
+ # Design issue that needs to be fixed in factory strategies.
7
+ - '#Return type \ (phpDocumentor\\Reflection\\DocBlock\|null\ ) of method phpDocumentor\\Reflection\\Php\\Factory\\DocBlock::create\ (\ ) should be compatible with return type \ (phpDocumentor\\Reflection\\Element\ ) of method phpDocumentor\\Reflection\\Php\\ProjectFactoryStrategy::create\ (\)#'
5
8
#
6
9
# all these $fqsen errors indicate the need for a decorator class around PhpParser\Node to hold the public $fqsen that Reflection is giving it)
7
10
#
8
11
# src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
12
+ - ' #Access to an undefined property PhpParser\\Node::\$fqsen\. #'
9
13
- ' #Access to an undefined property PhpParser\\Node\\Stmt\\Namespace_::\$fqsen\. #'
10
14
- ' #Access to an undefined property PhpParser\\Node\\Stmt\\Interface_::\$fqsen\. #'
11
15
- ' #Access to an undefined property PhpParser\\Node\\Stmt\\Function_::\$fqsen\. #'
@@ -35,6 +39,9 @@ parameters:
35
39
# there are some Elements doubling as Arguments, so we should probably tie their classes together somehow
36
40
# src/phpDocumentor/Reflection/Php/Factory/Function_.php
37
41
- '#Parameter \#1 \$argument of method phpDocumentor\\Reflection\\Php\\Function\_::addArgument\ (\ ) expects phpDocumentor\\Reflection\\Php\\Argument , phpDocumentor\\Reflection\\Element given\. #'
42
+
43
+ # Type hint in php-parser is incorrect.
44
+ - ' #Cannot cast PhpParser\\Node\\Expr\|string to string. #'
38
45
#
39
46
#
40
47
# many classes here that should have relationship to Element
Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ final class ElementNameResolver extends NodeVisitorAbstract
39
39
/**
40
40
* Resets the object to a known state before start processing.
41
41
*/
42
- public function beforeTraverse (array $ nodes ): void
42
+ public function beforeTraverse (array $ nodes )
43
43
{
44
44
$ this ->resetState ('\\' );
45
45
}
46
46
47
47
/**
48
48
* Performs a reset of the added element when needed.
49
49
*/
50
- public function leaveNode (Node $ node ): void
50
+ public function leaveNode (Node $ node )
51
51
{
52
52
switch (get_class ($ node )) {
53
53
case Namespace_::class:
@@ -83,12 +83,11 @@ public function enterNode(Node $node): ?int
83
83
case Class_::class:
84
84
case Trait_::class:
85
85
case Interface_::class:
86
- $ this ->parts ->push ((string ) $ node ->name );
87
-
88
86
if (empty ($ node ->name )) {
89
87
return NodeTraverser::DONT_TRAVERSE_CHILDREN ;
90
88
}
91
89
90
+ $ this ->parts ->push ((string )$ node ->name );
92
91
$ node ->fqsen = new Fqsen ($ this ->buildName ());
93
92
break ;
94
93
case Function_::class:
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function matches($object): bool
59
59
* @param Context $context of the created object
60
60
* @return null|DocBlockDescriptor
61
61
*/
62
- public function create ($ object , StrategyContainer $ strategies , ?Context $ context = null )
62
+ public function create ($ object , StrategyContainer $ strategies , ?Context $ context = null ): ? DocBlockDescriptor
63
63
{
64
64
if ($ object === null ) {
65
65
return null ;
Original file line number Diff line number Diff line change 16
16
17
17
use phpDocumentor \Reflection \DocBlockFactory ;
18
18
use phpDocumentor \Reflection \Exception ;
19
+ use phpDocumentor \Reflection \File as SourceFile ;
19
20
use phpDocumentor \Reflection \Fqsen ;
20
21
use phpDocumentor \Reflection \PrettyPrinter ;
21
22
use phpDocumentor \Reflection \Project as ProjectInterface ;
@@ -66,7 +67,7 @@ public static function createInstance(): self
66
67
* Creates a project from the set of files.
67
68
*
68
69
* @param string $name
69
- * @param File [] $files
70
+ * @param SourceFile [] $files
70
71
* @throws Exception when no matching strategy was found.
71
72
*/
72
73
public function create ($ name , array $ files ): ProjectInterface
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ private function aliasesToFullyQualifiedNames(Namespace_ $namespace) : array
44
44
}
45
45
46
46
/**
47
- * @param null| Namespace_ $namespace
47
+ * @param Namespace_ $namespace
48
48
*
49
49
* @return Use_[]|GroupUse[]
50
50
*/
You can’t perform that action at this time.
0 commit comments