Skip to content

Commit 60af519

Browse files
authored
[Fix] Docblock::tag(...) throws TypeError (#753)
the `Docblock::tag(...)` method throws a TypeError when specifying a non-existent tag.
1 parent 20df571 commit 60af519

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Util/Docblock.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ public function hasTag(string $tag): bool
212212
*
213213
* @param string $tag
214214
*
215-
* @return array
215+
* @return array|null
216216
*/
217-
public function tag(string $tag): array
217+
public function tag(string $tag)
218218
{
219+
// TODO: Add proper null-type return values once the lowest PHP version supported is 7.1
220+
219221
return $this->hasTag($tag) ? $this->tags[$tag] : null;
220222
}
221223

0 commit comments

Comments
 (0)