Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class DocBlockWrapper extends DocBlock |
||
10 | { |
||
11 | /** |
||
12 | * Returns doc tags by name (ignore case). |
||
13 | * |
||
14 | * @param string $name |
||
15 | * |
||
16 | * @return Collection|Tag[] |
||
17 | */ |
||
18 | public function getDocTags($name = null) |
||
19 | { |
||
20 | $tags = collect($this->getTags()); |
||
21 | |||
22 | if ($name === null) { |
||
23 | return $tags; |
||
24 | } |
||
25 | |||
26 | return $tags->filter(function (Tag $tag) use ($name) { |
||
27 | return strtolower($tag->getName()) === strtolower($name); |
||
28 | }); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Returns doc tag by name (ignore case). |
||
33 | * |
||
34 | * @param string $name |
||
35 | * |
||
36 | * @return Tag |
||
37 | */ |
||
38 | public function getDocTag($name) |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Checks if doc contains specified tag (ignore case). |
||
45 | * |
||
46 | * @param string $name |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function hasDocTag($name) |
||
53 | } |
||
54 | } |
||
55 |