8
8
use TypeLang \Parser \Parser as TypesParser ;
9
9
use TypeLang \Parser \ParserInterface as TypesParserInterface ;
10
10
use TypeLang \PHPDoc \DocBlock \Tag \Factory \TagFactoryInterface ;
11
- use TypeLang \PHPDoc \Parser \Content \OptionalTypeParserReader ;
11
+ use TypeLang \PHPDoc \Parser \Content \OptionalTypeReader ;
12
12
use TypeLang \PHPDoc \Parser \Content \OptionalValueReader ;
13
13
use TypeLang \PHPDoc \Parser \Content \Stream ;
14
14
use TypeLang \PHPDoc \Parser \Content \TypeParserReader ;
@@ -27,11 +27,11 @@ public function __construct(
27
27
28
28
public function create (string $ tag , string $ content , DescriptionParserInterface $ descriptions ): MethodTag
29
29
{
30
- $ stream = new Stream ($ content );
30
+ $ stream = new Stream ($ tag , $ content );
31
31
32
32
$ isStatic = $ stream ->apply (new OptionalValueReader ('static ' )) !== null ;
33
- $ returnType = $ stream ->apply (new TypeParserReader ($ tag , $ this ->parser ));
34
- $ callableType = $ stream ->apply (new OptionalTypeParserReader ($ this ->parser ));
33
+ $ returnType = $ stream ->apply (new TypeParserReader ($ this ->parser ));
34
+ $ callableType = $ stream ->apply (new OptionalTypeReader ($ this ->parser ));
35
35
36
36
// In case of return type has not been defined then we swap first
37
37
// defined type as method signature definition.
@@ -63,9 +63,7 @@ public function create(string $tag, string $content, DescriptionParserInterface
63
63
name: $ tag ,
64
64
type: $ callableType ,
65
65
static: $ isStatic ,
66
- description: \trim ($ stream ->value ) !== ''
67
- ? $ descriptions ->parse (\rtrim ($ stream ->value ))
68
- : null ,
66
+ description: $ stream ->toOptionalDescription ($ descriptions ),
69
67
);
70
68
}
71
69
}
0 commit comments