File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class RouteDocumentation {
1717 protected $ description ;
1818 protected $ params ;
1919 protected $ return ;
20+ protected $ deprecated ;
2021
2122 public $ resource ;
2223
@@ -64,6 +65,13 @@ public function __construct(Route $route) {
6465 } else {
6566 $ this ->return = new ReturnValue (ReturnValue::$ OTHER , '' );
6667 }
68+
69+ $ deprecation = $ docBlock ->getTagsByName ('deprecated ' );
70+ if (count ($ deprecation ) > 0 ) {
71+ $ tag = $ deprecation [0 ];
72+ $ notice = $ tag ->getContent ();
73+ $ this ->deprecated = empty ($ notice ) ? true : $ notice ;
74+ }
6775 }
6876
6977 /**
@@ -150,5 +158,13 @@ public function getReturn() {
150158 public function getResource () {
151159 return $ this ->resource ;
152160 }
161+
162+ public function isDeprecated () {
163+ return isset ($ this ->deprecated );
164+ }
165+
166+ public function getDeprecationMessage () {
167+ return ($ this ->deprecated === true ) ? false : $ this ->deprecated ;
168+ }
153169}
154170
Original file line number Diff line number Diff line change 44
55{!! $endpoint -> getDescription () ! !}
66
7+ @if ($endpoint -> isDeprecated () )
8+ @if ($message = $endpoint -> getDeprecationMessage () )
9+ <aside class =" warning" ><strong >Deprecated:</strong > {{ $message } } </aside >
10+ @else
11+ <aside class =" warning" ><strong >Deprecated</strong ></aside >
12+ @endif
13+ @endif
14+
715@if (count ($endpoint -> getParams ()) > 0 )
816### Parameters
917
You can’t perform that action at this time.
0 commit comments