Skip to content

Commit 1952fa9

Browse files
committed
refactor(ApiResponseFactory): change return type for apiResponse method
- Change the return type of the apiResponse method to ApiResponse. - Update method implementation to use resolve() instead of app() for better clarity and consistency. - This refactor improves type safety and clarifies the expected output of the method.
1 parent 290fd84 commit 1952fa9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Support/Traits/ApiResponseFactory.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414
namespace Guanguans\LaravelApiResponse\Support\Traits;
1515

16+
use Guanguans\LaravelApiResponse\ApiResponse;
1617
use Guanguans\LaravelApiResponse\Contracts\ApiResponseContract;
1718

1819
trait ApiResponseFactory
1920
{
20-
/**
21-
* @noinspection PhpDocSignatureInspection
22-
*
23-
* @return \Guanguans\LaravelApiResponse\ApiResponse|\Guanguans\LaravelApiResponse\Contracts\ApiResponseContract
24-
*/
25-
public function apiResponse(): ApiResponseContract
21+
public function apiResponse(): ApiResponse
2622
{
27-
return app(ApiResponseContract::class);
23+
return resolve(ApiResponseContract::class);
2824
}
2925
}

0 commit comments

Comments
 (0)