File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ public function getParams(): array {
59
59
return $ this ->tags ->getParams ();
60
60
}
61
61
62
+ public function getSince (): string {
63
+ return $ this ->tags ->getSince ();
64
+ }
65
+
62
66
public function getReturnTypeString (): ?string {
63
67
return $ this ->tags ->getReturnTypeString ();
64
68
}
Original file line number Diff line number Diff line change @@ -55,6 +55,22 @@ public function getParams(): array {
55
55
return $ this ->getByType ( 'param ' );
56
56
}
57
57
58
+ public function getSince (): string {
59
+ foreach ( $ this ->tags as $ tag ) {
60
+ if ( $ tag ->getName () === 'since ' ) {
61
+ $ since = $ tag ->getContent ();
62
+
63
+ if ( strpos ( $ since , 'MU ' ) !== false ) {
64
+ $ since = '3.0.0 ' ;
65
+ }
66
+
67
+ return $ since ;
68
+ }
69
+ }
70
+
71
+ return '' ;
72
+ }
73
+
58
74
/**
59
75
* @return array<int, Tag>
60
76
* @phpstan-return list<Tag>
Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ public function testCanCountParams(): void {
91
91
self ::assertSame ( 2 , $ count );
92
92
}
93
93
94
+ public function testCanGetSince (): void {
95
+ $ hooks = $ this ->getFilters ();
96
+ $ hook = $ hooks ->find ( 'wp_tag_cloud ' );
97
+
98
+ $ since = $ hook ->getDoc ()->getSince ();
99
+
100
+ self ::assertSame ( '2.3.0 ' , $ since );
101
+ }
102
+
94
103
/**
95
104
* @return array<string, array<int, string>>
96
105
* @phpstan-return array{
You can’t perform that action at this time.
0 commit comments