mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-11-30 04:29:20 +01:00
Fix BC break vs. 1.0.0
This commit is contained in:
parent
d26926e2ac
commit
dbc093d7af
@ -25,7 +25,7 @@ class ParamTagValueNode implements PhpDocTagValueNode
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, bool $isReference, bool $isVariadic, string $parameterName, string $description)
|
||||
public function __construct(TypeNode $type, bool $isVariadic, string $parameterName, string $description, bool $isReference = false)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->isReference = $isReference;
|
||||
|
@ -224,7 +224,7 @@ class PhpDocParser
|
||||
$isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC);
|
||||
$parameterName = $this->parseRequiredVariableName($tokens);
|
||||
$description = $this->parseOptionalDescription($tokens);
|
||||
return new Ast\PhpDoc\ParamTagValueNode($type, $isReference, $isVariadic, $parameterName, $description);
|
||||
return new Ast\PhpDoc\ParamTagValueNode($type, $isVariadic, $parameterName, $description, $isReference);
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,7 +99,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
''
|
||||
)
|
||||
@ -116,7 +115,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'optional description'
|
||||
)
|
||||
@ -132,7 +130,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
'@param',
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
true,
|
||||
'$foo',
|
||||
''
|
||||
@ -149,7 +146,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
'@param',
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
true,
|
||||
'$foo',
|
||||
'optional description'
|
||||
@ -166,10 +162,10 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
'@param',
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
true,
|
||||
false,
|
||||
'$foo',
|
||||
''
|
||||
'',
|
||||
true
|
||||
)
|
||||
),
|
||||
]),
|
||||
@ -183,10 +179,10 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
'@param',
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
true,
|
||||
false,
|
||||
'$foo',
|
||||
'optional description'
|
||||
'optional description',
|
||||
true
|
||||
)
|
||||
),
|
||||
]),
|
||||
@ -201,9 +197,9 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
true,
|
||||
true,
|
||||
'$foo',
|
||||
''
|
||||
'',
|
||||
true
|
||||
)
|
||||
),
|
||||
]),
|
||||
@ -218,9 +214,9 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
true,
|
||||
true,
|
||||
'$foo',
|
||||
'optional description'
|
||||
'optional description',
|
||||
true
|
||||
)
|
||||
),
|
||||
]),
|
||||
@ -235,7 +231,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new ConstTypeNode(new ConstFetchNode('self', '*')),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'optional description'
|
||||
)
|
||||
@ -1945,7 +1940,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'1st multi world description'
|
||||
)
|
||||
@ -1955,7 +1949,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Bar'),
|
||||
false,
|
||||
false,
|
||||
'$bar',
|
||||
'2nd multi world description'
|
||||
)
|
||||
@ -1975,7 +1968,6 @@ class PhpDocParserTest extends \PHPUnit\Framework\TestCase
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'1st multi world description
|
||||
some text in the middle'
|
||||
@ -1986,7 +1978,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Bar'),
|
||||
false,
|
||||
false,
|
||||
'$bar',
|
||||
'2nd multi world description'
|
||||
)
|
||||
@ -2017,7 +2008,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Foo'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'1st multi world description with empty lines'
|
||||
)
|
||||
@ -2032,7 +2022,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Bar'),
|
||||
false,
|
||||
false,
|
||||
'$bar',
|
||||
'2nd multi world description with empty lines'
|
||||
)
|
||||
@ -2066,7 +2055,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('int'),
|
||||
false,
|
||||
false,
|
||||
'$foo',
|
||||
'@param string $bar'
|
||||
)
|
||||
@ -2982,7 +2970,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('class-string'),
|
||||
false,
|
||||
false,
|
||||
'$test',
|
||||
''
|
||||
)
|
||||
@ -2999,7 +2986,6 @@ some text in the middle'
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('class-string'),
|
||||
false,
|
||||
false,
|
||||
'$test',
|
||||
'some description'
|
||||
)
|
||||
@ -3293,7 +3279,6 @@ time are not reliable as field settings might be missing.'),
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('\Drupal\Core\Field\FieldStorageDefinitionInterface'),
|
||||
false,
|
||||
false,
|
||||
'$field_definition',
|
||||
''
|
||||
)
|
||||
@ -3371,7 +3356,6 @@ time are not reliable as field settings might be missing.'),
|
||||
new ParamTagValueNode(
|
||||
new IdentifierTypeNode('Request'),
|
||||
false,
|
||||
false,
|
||||
'$request',
|
||||
'- The request object'
|
||||
)
|
||||
@ -3592,7 +3576,6 @@ Finder::findFiles('*.php')
|
||||
new ParamTagValueNode(
|
||||
new ConstTypeNode(new ConstFetchNode('DateTimeImmutable', 'ATOM')),
|
||||
false,
|
||||
false,
|
||||
'$a',
|
||||
''
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user