Skip to content

The missing exception error is reported in first found DocBlock #752

@aik099

Description

@aik099

Consider following code:

class Test
{
    /**
     * Folder name.
     *
     * @var string
     */
    protected $folderName;

    protected function setUp()
    {
        parent::setUp();

        if ( !strlen($this->folderName) ) {
            throw new \RuntimeException('The $this->folderName must be specified before proceeding.');
        }
    }
}

The error about missing @throws tag is reported at class property DocBlock by mistake, because method doesn't have any DocBlock.

I think, that in case if DocBlock is totally missing we should not report any error or report it at function declaration keyword.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions