-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/bugSomething is brokenSomething is broken
Description
Q | A |
---|---|
PHPUnit version | 8.5.2 |
PHP version | 7.2.28 |
Installation Method | Composer |
Current behavior
\PHPUnit\Util\Annotation\DocBlock::ofMethod
tries to instantiate the DocBlock class, the problem is that it doesn't check if the \ReflectionMethod $method
that it receives contains all the needed data that is passed to the constructor. For example I ran into a case where $method->getStartLine()
, $method->getEndLine()
etc returns false
, but the constructor expects int
and everything breaks then.
Argument 4 passed to PHPUnit\Util\Annotation\DocBlock::__construct() must be of the type integer, boolean given, called in /webroot_data/webroot/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php on line 118
How to reproduce
Call \PHPUnit\Util\Annotation\DocBlock::ofMethod
with an \ReflectionMethod
instance which only has the class
and name
properties set.
Expected behavior
The \PHPUnit\Util\Annotation\DocBlock
class should be instantiated without errors.
Metadata
Metadata
Assignees
Labels
type/bugSomething is brokenSomething is broken