File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 55use Barryvdh \Reflection \DocBlock ;
66use Barryvdh \Reflection \DocBlock \Tag ;
77use Illuminate \Database \Eloquent \Builder as EloquentBuilder ;
8+ use Illuminate \Http \Client \PendingRequest ;
89use Illuminate \Support \Collection ;
910
1011class Macro extends Method
1112{
13+ protected $ macroDefaults = [
14+ \Illuminate \Http \Client \Factory::class => PendingRequest::class,
15+ ];
16+
1217 /**
1318 * Macro constructor.
1419 *
@@ -77,6 +82,12 @@ protected function initPhpDoc($method)
7782
7883 $ this ->phpdoc ->appendTag (Tag::createInstance ("@return {$ type }" ));
7984 }
85+
86+ $ class = ltrim ($ this ->declaringClassName , '\\' );
87+ if (!$ this ->phpdoc ->hasTag ('return ' ) && isset ($ this ->macroDefaults [$ class ])) {
88+ $ type = $ this ->macroDefaults [$ class ];
89+ $ this ->phpdoc ->appendTag (Tag::createInstance ("@return {$ type }" ));
90+ }
8091 }
8192
8293 protected function concatReflectionTypes (?\ReflectionType $ type ): string
You can’t perform that action at this time.
0 commit comments