This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-22
lines changed
src/Reflection/DocBlock/Tag Expand file tree Collapse file tree 1 file changed +18
-22
lines changed Original file line number Diff line number Diff line change 12
12
class VarTag implements TagInterface, PhpDocTypedTagInterface
13
13
{
14
14
/**
15
- * @var array
15
+ * @var string[]
16
16
*/
17
- protected $ types = [];
17
+ private $ types = [];
18
18
19
19
/**
20
- * @var string
20
+ * @var string|null
21
21
*/
22
- protected $ variableName = null ;
22
+ private $ variableName ;
23
23
24
24
/**
25
- * @var string
25
+ * @var string|null
26
26
*/
27
- protected $ description = null ;
27
+ private $ description ;
28
28
29
29
/**
30
- * @return string
30
+ * {@inheritDoc}
31
31
*/
32
- public function getName ()
32
+ public function getName () : string
33
33
{
34
34
return 'var ' ;
35
35
}
36
36
37
37
/**
38
- * Initializer
39
- *
40
- * @param string $tagDocblockLine
38
+ * {@inheritDoc}
41
39
*/
42
- public function initialize ($ tagDocblockLine )
40
+ public function initialize ($ tagDocblockLine ) : void
43
41
{
44
42
$ match = [];
43
+
45
44
if (!preg_match ('#^(.+)?(\$[\S]+)\s*(.*)$#m ' , $ tagDocblockLine , $ match )) {
46
45
return ;
47
46
}
@@ -59,28 +58,25 @@ public function initialize($tagDocblockLine)
59
58
}
60
59
}
61
60
62
- public function getTypes ()
61
+ /**
62
+ * {@inheritDoc}
63
+ */
64
+ public function getTypes () : array
63
65
{
64
66
return $ this ->types ;
65
67
}
66
68
67
- /**
68
- * @return null|string
69
- */
70
- public function getVariableName ()
69
+ public function getVariableName () : ?string
71
70
{
72
71
return $ this ->variableName ;
73
72
}
74
73
75
- /**
76
- * @return null|string
77
- */
78
- public function getDescription ()
74
+ public function getDescription () : ?string
79
75
{
80
76
return $ this ->description ;
81
77
}
82
78
83
- public function __toString ()
79
+ public function __toString () : string
84
80
{
85
81
return 'DocBlock Tag [ * @ ' . $ this ->getName () . ' ] ' . PHP_EOL ;
86
82
}
You can’t perform that action at this time.
0 commit comments