@@ -23,12 +23,9 @@ class LongDescription implements \Reflector
23
23
{
24
24
/** @var string */
25
25
protected $ contents = '' ;
26
-
27
- /** @var \phpDocumentor\Reflection\DocBlock\Tags[] */
28
- protected $ tags = array ();
29
26
30
27
/** @var array The contents, as an array of strings and Tag objects. */
31
- protected $ parsedContents = array () ;
28
+ protected $ parsedContents = null ;
32
29
33
30
/**
34
31
* Parses the string for inline tags and if the Markdown class is included;
@@ -38,16 +35,7 @@ class LongDescription implements \Reflector
38
35
*/
39
36
public function __construct ($ content )
40
37
{
41
- $ this ->parsedContents = preg_split (
42
- '/\{(\@.*)\}/uS ' ,
43
- $ this ->contents = trim ($ content ),
44
- null , PREG_SPLIT_DELIM_CAPTURE
45
- );
46
- for ($ i =1 , $ l = count ($ this ->parsedContents ); $ i <$ l ; $ i += 2 ) {
47
- $ this ->parsedContents [$ i ] = $ this ->tags [] = Tag::createInstance (
48
- $ this ->parsedContents [$ i ]
49
- );
50
- }
38
+ $ this ->contents = trim ($ content );
51
39
}
52
40
53
41
/**
@@ -68,6 +56,17 @@ public function getContents()
68
56
*/
69
57
public function getParsedContents ()
70
58
{
59
+ if (null === $ this ->parsedContents ) {
60
+ $ this ->parsedContents = preg_split (
61
+ '/\{(\@.*)\}/uS ' , $ this ->contents ,
62
+ null , PREG_SPLIT_DELIM_CAPTURE
63
+ );
64
+ for ($ i =1 , $ l = count ($ this ->parsedContents ); $ i <$ l ; $ i += 2 ) {
65
+ $ this ->parsedContents [$ i ] = Tag::createInstance (
66
+ $ this ->parsedContents [$ i ]
67
+ );
68
+ }
69
+ }
71
70
return $ this ->parsedContents ;
72
71
}
73
72
@@ -102,16 +101,6 @@ public function getFormattedContents()
102
101
return trim ($ result );
103
102
}
104
103
105
- /**
106
- * Returns a list of tags mentioned in the text.
107
- *
108
- * @return \phpDocumentor\Reflection\DocBlock\Tags[]
109
- */
110
- public function getTags ()
111
- {
112
- return $ this ->tags ;
113
- }
114
-
115
104
/**
116
105
* Builds a string representation of this object.
117
106
*
0 commit comments