Skip to content

Bug with @var tag in docblock #117

@Warxcell

Description

@Warxcell

I'm parsing this file's docblocks:

https://github.com/bzikarsky/gelf-php/blob/master/src/Gelf/Publisher.php

and

/**
* @var Set
*/
protected $transports;

becomes

/**
* 
*
* @var \Set $ 
*/
protected $transports;

When using serializer to modify the docblock and save it back to file.

And then when parsed again, it throws InvalidArgumentException.

HP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Expected a string. Got: boolean' in vendor/webmozart/assert/src/Assert.php:942
Stack trace:
#0 vendor/webmozart/assert/src/Assert.php(157): Webmozart\Assert\Assert::reportInvalidArgument('Expected a stri...')
#1 vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php(43): Webmozart\Assert\Assert::string(false)
#2 vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php(84): phpDocumentor\Reflection\DocBlock\Tags\Var_->__construct(false, Object(phpDocumentor\Reflection\Types\Object_), Object(phpDocumentor\Reflection\DocBlock\Description))
#3 [internal function]: phpDocumentor\Reflection\DocBlock\Tags\Var_::create('\Set $', Object(phpDocumentor\Reflection\TypeResolver), Object(phpDocumentor\Reflection\DocBlock\DescriptionFactory), Object(phpDocumentor\Reflection\Types\Context))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions