18
18
/**
19
19
* Reflection class for an @author tag in a Docblock.
20
20
*
21
- * @author Vasil Rangelov <boen.robot@gmail .com>
21
+ * @author Mike van Riel <mike.vanriel@naenius .com>
22
22
* @license http://www.opensource.org/licenses/mit-license.php MIT
23
23
* @link http://phpdoc.org
24
24
*/
@@ -27,11 +27,8 @@ class AuthorTag extends Tag
27
27
/** @var string The name of the author */
28
28
protected $ name = '' ;
29
29
30
- /** @var array Array of URIs belonging to the author, including email */
31
- protected $ uris = array ();
32
-
33
- /** @var string The role of the author */
34
- protected $ role = '' ;
30
+ /** @var string The email of the author */
31
+ protected $ email = '' ;
35
32
36
33
/**
37
34
* Parses a tag and populates the member variables.
@@ -44,32 +41,14 @@ public function __construct($type, $content, DocBlock $docblock = null)
44
41
{
45
42
parent ::__construct ($ type , $ content , $ docblock );
46
43
if (preg_match (
47
- '/^
48
- # Name
49
- ([^\<]*)
50
- (?:
51
- # URIs
52
- \<([^>]*)\>\s*
53
- # Role
54
- (?:
55
- \(([^\)]*)\)
56
- )?
57
- # Description
58
- (.*)
59
- )?
60
- $/sux ' ,
44
+ '/^([^\<]*)(\<([^\>]*)\>)?$/ ' ,
61
45
$ this ->description ,
62
46
$ matches
63
47
)) {
64
- $ this ->name = rtrim ($ matches [1 ]);
65
- if (isset ($ matches [2 ])) {
66
- $ matches [2 ] = trim ($ matches [2 ]);
67
- if ('' !== $ matches [2 ]) {
68
- $ this ->uris = preg_split ('/\s+/u ' , $ matches [2 ]);
69
- }
48
+ $ this ->name = trim ($ matches [1 ]);
49
+ if (isset ($ matches [3 ])) {
50
+ $ this ->email = trim ($ matches [3 ]);
70
51
}
71
- $ this ->role = isset ($ matches [3 ]) ? trim ($ matches [3 ]) : '' ;
72
- $ this ->description = isset ($ matches [4 ]) ? trim ($ matches [4 ]) : '' ;
73
52
}
74
53
}
75
54
@@ -84,22 +63,12 @@ public function getAuthorName()
84
63
}
85
64
86
65
/**
87
- * Gets the author's URIs .
66
+ * Gets the author's email .
88
67
*
89
- * @return array Array of URIs belonging to the author, including email.
68
+ * @return string The author's email.
90
69
*/
91
- public function getAuthorURIs ()
70
+ public function getAuthorEmail ()
92
71
{
93
- return $ this ->uris ;
94
- }
95
-
96
- /**
97
- * Gets the author's role.
98
- *
99
- * @return string The role of the author.
100
- */
101
- public function getAuthorRole ()
102
- {
103
- return $ this ->role ;
72
+ return $ this ->email ;
104
73
}
105
74
}
0 commit comments