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 {
5959 return $ this ->tags ->getParams ();
6060 }
6161
62+ public function getSince (): string {
63+ return $ this ->tags ->getSince ();
64+ }
65+
6266 public function getReturnTypeString (): ?string {
6367 return $ this ->tags ->getReturnTypeString ();
6468 }
Original file line number Diff line number Diff line change @@ -55,6 +55,22 @@ public function getParams(): array {
5555 return $ this ->getByType ( 'param ' );
5656 }
5757
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+
5874 /**
5975 * @return array<int, Tag>
6076 * @phpstan-return list<Tag>
Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ public function testCanCountParams(): void {
9191 self ::assertSame ( 2 , $ count );
9292 }
9393
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+
94103 /**
95104 * @return array<string, array<int, string>>
96105 * @phpstan-return array{
You can’t perform that action at this time.
0 commit comments