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/composer.json b/composer.json index 29c1d4a..d5ccab3 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,7 @@ "phpunit/phpunit": "^9.5", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.18", + "vimeo/psalm": "^4.30|^5.8", "yiisoft/json": "^1.0", "yiisoft/yii-debug-api": "^3.0@dev", "yiisoft/yii-debug-viewer": "^3.0@dev", diff --git a/psalm.xml b/psalm.xml index a3df094..169d670 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,8 @@ + + + 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 806ad02..8553d70 100644 --- a/src/Auth/AuthRequest.php +++ b/src/Auth/AuthRequest.php @@ -13,6 +13,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", 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;