Skip to content

Commit ebb723c

Browse files
committed
add support for helper function
1 parent 1d05f7d commit ebb723c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/HelpersReturnTypeExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ final class HelpersReturnTypeExtension implements DynamicFunctionReturnTypeExten
2020
*/
2121
private $helpers = [
2222
'app',
23+
'response',
2324
'validator',
2425
'view',
2526
];
@@ -54,7 +55,12 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
5455
}
5556

5657
return new MixedType();
58+
case 'response':
59+
if (empty($functionCall->args)) {
60+
return new ObjectType(\Illuminate\Contracts\Routing\ResponseFactory::class);
61+
}
5762

63+
return new ObjectType(\Illuminate\Http\Response::class);
5864
case 'validator':
5965
if (empty($functionCall->args)) {
6066
return new ObjectType(\Illuminate\Contracts\Validation\Factory::class);

0 commit comments

Comments
 (0)