From 98b9ba107ccdf178ade47910141d60fc09726eeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 22:06:32 +0000 Subject: [PATCH 1/4] Update vimeo/psalm requirement from ^4.18 to ^5.8 Updates the requirements on [vimeo/psalm](https://github.com/vimeo/psalm) to permit the latest version. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/4.18...5.8.0) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c45734f..d2129a8 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,7 @@ "phpunit/phpunit": "^9.5", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.18", + "vimeo/psalm": "^5.8", "yiisoft/json": "^1.0", "yiisoft/yii-debug-viewer": "^3.0@dev", "yiisoft/yii-testing": "dev-master" From 247e078efde0661654d7f29ec02a063b2f1084e0 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 11 Oct 2023 14:20:21 +0300 Subject: [PATCH 2/4] improve --- composer.json | 2 +- psalm.xml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d2129a8..1708ea1 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,7 @@ "phpunit/phpunit": "^9.5", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^5.8", + "vimeo/psalm": "^4.30|^5.8", "yiisoft/json": "^1.0", "yiisoft/yii-debug-viewer": "^3.0@dev", "yiisoft/yii-testing": "dev-master" diff --git a/psalm.xml b/psalm.xml index a3df094..169d670 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,8 @@ + + + From a564f648de4465e1770cad890de54fe258c907af Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 11 Oct 2023 11:20:46 +0000 Subject: [PATCH 3/4] Apply fixes from StyleCI --- config/web/di/application.php | 2 +- src/Auth/AuthController.php | 13 +++++++++++++ src/Auth/AuthRequest.php | 1 + src/Dto/ApiResponseData.php | 1 + src/Formatter/PaginatorFormatter.php | 1 + src/InfoController.php | 4 ++++ 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/config/web/di/application.php b/config/web/di/application.php index 8827398..736c6fa 100644 --- a/config/web/di/application.php +++ b/config/web/di/application.php @@ -14,7 +14,7 @@ Yiisoft\Yii\Http\Application::class => [ '__construct()' => [ 'dispatcher' => DynamicReference::to(static function (Injector $injector) use ($params) { - return ($injector->make(MiddlewareDispatcher::class)) + return $injector->make(MiddlewareDispatcher::class) ->withMiddlewares($params['middlewares']); }), 'fallbackHandler' => Reference::to(NotFoundHandler::class), diff --git a/src/Auth/AuthController.php b/src/Auth/AuthController.php index 095651f..4cddb8d 100644 --- a/src/Auth/AuthController.php +++ b/src/Auth/AuthController.php @@ -42,13 +42,17 @@ public function __construct( * path="/auth/", * summary="Authenticate by params", * description="", + * * @OA\Response( * response="200", * description="Success", + * * @OA\JsonContent( * allOf={ + * * @OA\Schema(ref="#/components/schemas/Response"), * @OA\Schema( + * * @OA\Property( * property="data", * type="object", @@ -58,15 +62,20 @@ public function __construct( * }, * ) * ), + * * @OA\Response( * response="400", * description="Bad request", + * * @OA\JsonContent(ref="#/components/schemas/BadResponse") * ), + * * @OA\RequestBody( * required=true, + * * @OA\MediaType( * mediaType="application/json", + * * @OA\Schema(ref="#/components/schemas/AuthRequest"), * ), * ), @@ -90,14 +99,18 @@ public function login(AuthRequest $request): ResponseInterface * summary="Logout", * description="", * security={{"ApiKey": {}}}, + * * @OA\Response( * response="200", * description="Success", + * * @OA\JsonContent(ref="#/components/schemas/Response") * ), + * * @OA\Response( * response="400", * description="Bad request", + * * @OA\JsonContent(ref="#/components/schemas/BadResponse") * ), * ) diff --git a/src/Auth/AuthRequest.php b/src/Auth/AuthRequest.php index f6b1f55..3cea08f 100644 --- a/src/Auth/AuthRequest.php +++ b/src/Auth/AuthRequest.php @@ -12,6 +12,7 @@ /** * @OA\Schema( * schema="AuthRequest", + * * @OA\Property(example="Opal1144", property="login", format="string"), * @OA\Property(example="Opal1144", property="password", format="string"), * ) diff --git a/src/Dto/ApiResponseData.php b/src/Dto/ApiResponseData.php index 60b542e..952e059 100644 --- a/src/Dto/ApiResponseData.php +++ b/src/Dto/ApiResponseData.php @@ -15,6 +15,7 @@ * allOf={ * @OA\Schema(ref="#/components/schemas/Response"), * @OA\Schema( + * * @OA\Property( * property="status", * example="failed", diff --git a/src/Formatter/PaginatorFormatter.php b/src/Formatter/PaginatorFormatter.php index ec2808e..527a9ee 100644 --- a/src/Formatter/PaginatorFormatter.php +++ b/src/Formatter/PaginatorFormatter.php @@ -10,6 +10,7 @@ /** * @OA\Schema( * schema="Paginator", + * * @OA\Property(example="10", property="pageSize", format="int"), * @OA\Property(example="1", property="currentPage", format="int"), * @OA\Property(example="3", property="totalPages", format="int"), diff --git a/src/InfoController.php b/src/InfoController.php index 57a5e8a..1479dce 100644 --- a/src/InfoController.php +++ b/src/InfoController.php @@ -18,13 +18,17 @@ class InfoController * path="/", * summary="Returns info about the API", * description="", + * * @OA\Response( * response="200", * description="Success", + * * @OA\JsonContent( * allOf={ + * * @OA\Schema(ref="#/components/schemas/Response"), * @OA\Schema( + * * @OA\Property( * property="data", * type="object", From e81e16e241c90549f5d67cedc8ce2bd4376a29ae Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 11 Oct 2023 14:34:13 +0300 Subject: [PATCH 4/4] fix --- .github/workflows/static.yml | 5 +++-- src/User/UserRepository.php | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 55b78cf..e0ef404 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -38,8 +38,9 @@ jobs: - ubuntu-latest php: - - 8.0 - - 8.1 + - "8.0" + - "8.1" + - "8.2" steps: - name: Checkout diff --git a/src/User/UserRepository.php b/src/User/UserRepository.php index 3b98cb7..3ac78be 100644 --- a/src/User/UserRepository.php +++ b/src/User/UserRepository.php @@ -11,6 +11,9 @@ use Yiisoft\Auth\IdentityRepositoryInterface; use Yiisoft\Auth\IdentityWithTokenRepositoryInterface; +/** + * @extends Select\Repository + */ final class UserRepository extends Select\Repository implements IdentityWithTokenRepositoryInterface, IdentityRepositoryInterface { private ORMInterface $orm;