Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit eb4964e

Browse files
committed
#41 adding return hints where applicable in the reflection VarTag
1 parent 0e6d7df commit eb4964e

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

src/Reflection/DocBlock/Tag/VarTag.php

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,35 @@
1212
class VarTag implements TagInterface, PhpDocTypedTagInterface
1313
{
1414
/**
15-
* @var array
15+
* @var string[]
1616
*/
17-
protected $types = [];
17+
private $types = [];
1818

1919
/**
20-
* @var string
20+
* @var string|null
2121
*/
22-
protected $variableName = null;
22+
private $variableName;
2323

2424
/**
25-
* @var string
25+
* @var string|null
2626
*/
27-
protected $description = null;
27+
private $description;
2828

2929
/**
30-
* @return string
30+
* {@inheritDoc}
3131
*/
32-
public function getName()
32+
public function getName() : string
3333
{
3434
return 'var';
3535
}
3636

3737
/**
38-
* Initializer
39-
*
40-
* @param string $tagDocblockLine
38+
* {@inheritDoc}
4139
*/
42-
public function initialize($tagDocblockLine)
40+
public function initialize($tagDocblockLine) : void
4341
{
4442
$match = [];
43+
4544
if (!preg_match('#^(.+)?(\$[\S]+)\s*(.*)$#m', $tagDocblockLine, $match)) {
4645
return;
4746
}
@@ -59,28 +58,25 @@ public function initialize($tagDocblockLine)
5958
}
6059
}
6160

62-
public function getTypes()
61+
/**
62+
* {@inheritDoc}
63+
*/
64+
public function getTypes() : array
6365
{
6466
return $this->types;
6567
}
6668

67-
/**
68-
* @return null|string
69-
*/
70-
public function getVariableName()
69+
public function getVariableName() : ?string
7170
{
7271
return $this->variableName;
7372
}
7473

75-
/**
76-
* @return null|string
77-
*/
78-
public function getDescription()
74+
public function getDescription() : ?string
7975
{
8076
return $this->description;
8177
}
8278

83-
public function __toString()
79+
public function __toString() : string
8480
{
8581
return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;
8682
}

0 commit comments

Comments
 (0)