assertSame('Some Description', $comment_docblock[0]->description); } public function testDocblockVarDescriptionWithVarId(): void { $doc = '/** * @var string $foo Some Description */ '; $php_parser_doc = new Doc($doc); $comment_docblock = CommentAnalyzer::getTypeFromComment($php_parser_doc, new FileScanner('somefile.php', 'somefile.php', false), new Aliases); $this->assertSame('Some Description', $comment_docblock[0]->description); } public function testDocblockVarDescriptionMultiline(): void { $doc = '/** * @var string $foo Some Description * with a long description. */ '; $php_parser_doc = new Doc($doc); $comment_docblock = CommentAnalyzer::getTypeFromComment($php_parser_doc, new FileScanner('somefile.php', 'somefile.php', false), new Aliases); $this->assertSame('Some Description with a long description.', $comment_docblock[0]->description); } public function testDocblockDescription(): void { $doc = '/** * Some Description * * @var string */ '; $php_parser_doc = new Doc($doc); $comment_docblock = CommentAnalyzer::getTypeFromComment($php_parser_doc, new FileScanner('somefile.php', 'somefile.php', false), new Aliases); $this->assertSame('Some Description', $comment_docblock[0]->description); } public function testDocblockDescriptionWithVarDescription(): void { $doc = '/** * Some Description * * @var string Use a string */ '; $php_parser_doc = new Doc($doc); $comment_docblock = CommentAnalyzer::getTypeFromComment($php_parser_doc, new FileScanner('somefile.php', 'somefile.php', false), new Aliases); $this->assertSame('Use a string', $comment_docblock[0]->description); } }