From 4c95d5facef9a32a3c757d93c371f57783dd6b4e Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 21 Feb 2024 09:57:05 +0000 Subject: [PATCH] Apply fixes from StyleCI --- blog-api/src/Auth/AuthController.php | 56 ++++----- blog-api/src/Auth/AuthRequest.php | 9 +- blog-api/src/Blog/BlogController.php | 112 +++++++++--------- blog-api/src/Blog/EditPostRequest.php | 11 +- blog-api/src/Blog/PostFormatter.php | 11 +- blog-api/src/Dto/ApiResponseData.php | 36 +++--- blog-api/src/Formatter/PaginatorFormatter.php | 11 +- blog-api/src/InfoController.php | 22 ++-- blog-api/src/User/UserController.php | 58 ++++----- blog-api/src/User/UserFormatter.php | 9 +- blog/src/Controller/Actions/ApiInfo.php | 22 ++-- blog/src/Middleware/ApiDataWrapper.php | 8 +- .../src/User/Controller/ApiUserController.php | 53 +++++---- 13 files changed, 217 insertions(+), 201 deletions(-) diff --git a/blog-api/src/Auth/AuthController.php b/blog-api/src/Auth/AuthController.php index 49855de4..de3a7924 100644 --- a/blog-api/src/Auth/AuthController.php +++ b/blog-api/src/Auth/AuthController.php @@ -10,8 +10,8 @@ use Psr\Http\Message\ResponseInterface; use Yiisoft\DataResponse\DataResponseFactoryInterface as ResponseFactory; -#[OA\Tag(name: "auth", description: "Authentication")] -#[OA\SecurityScheme(securityScheme: "ApiKey", type: "apiKey", name: "X-Api-Key", in: "header")] +#[OA\Tag(name: 'auth', description: 'Authentication')] +#[OA\SecurityScheme(securityScheme: 'ApiKey', type: 'apiKey', name: 'X-Api-Key', in: 'header')] final class AuthController { private ResponseFactory $responseFactory; @@ -26,36 +26,38 @@ public function __construct( } #[OA\Post( - path: "/auth/", - description: "", - summary: "Authenticate by params", + path: '/auth/', + description: '', + summary: 'Authenticate by params', requestBody: new OA\RequestBody(required: true, content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/AuthRequest"), + new OA\Schema(ref: '#/components/schemas/AuthRequest'), ] )), - tags: ["auth"], + tags: ['auth'], responses: [ new OA\Response( - response: "200", - description: "Success", + response: '200', + description: 'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", + property: 'data', properties: [ - new OA\Property(property: "token", type: "string", example: "uap4X5Bd7078lxIFvxAflcGAa5D95iSSZkNjg3XFrE2EBRBlbj") + new OA\Property(property: 'token', type: 'string', example: 'uap4X5Bd7078lxIFvxAflcGAa5D95iSSZkNjg3XFrE2EBRBlbj'), ], - type: "object"), + type: 'object' + ), ]), - ]) + ] + ) ), new OA\Response( - response: "400", - description: "Bad request", - content: new OA\JsonContent(ref: "#/components/schemas/BadResponse") + response: '400', + description: 'Bad request', + content: new OA\JsonContent(ref: '#/components/schemas/BadResponse') ), ] )] @@ -74,21 +76,21 @@ public function login(AuthRequest $request): ResponseInterface } #[OA\Post( - path: "/logout/", - description: "", - summary: "Logout", + path: '/logout/', + description: '', + summary: 'Logout', security: [new OA\SecurityScheme(ref: '#/components/securitySchemes/ApiKey')], - tags: ["auth"], + tags: ['auth'], responses: [ new OA\Response( - response: "200", - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Response") + response: '200', + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/Response') ), new OA\Response( - response: "400", - description: "Bad request", - content: new OA\JsonContent(ref: "#/components/schemas/BadResponse") + response: '400', + description: 'Bad request', + content: new OA\JsonContent(ref: '#/components/schemas/BadResponse') ), ] )] diff --git a/blog-api/src/Auth/AuthRequest.php b/blog-api/src/Auth/AuthRequest.php index a616cee2..d72bdfbb 100644 --- a/blog-api/src/Auth/AuthRequest.php +++ b/blog-api/src/Auth/AuthRequest.php @@ -11,11 +11,12 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "AuthRequest", + schema: 'AuthRequest', properties: [ - new OA\Property(property: 'login', type: "string", example: 'Opal1144'), - new OA\Property(property: 'password', type: "string", example: 'Opal1144'), - ])] + new OA\Property(property: 'login', type: 'string', example: 'Opal1144'), + new OA\Property(property: 'password', type: 'string', example: 'Opal1144'), + ] +)] final class AuthRequest implements RequestInputInterface, RulesProviderInterface { #[Body('login')] diff --git a/blog-api/src/Blog/BlogController.php b/blog-api/src/Blog/BlogController.php index e9f7cbc6..88e051b7 100644 --- a/blog-api/src/Blog/BlogController.php +++ b/blog-api/src/Blog/BlogController.php @@ -12,8 +12,8 @@ use Yiisoft\Input\Http\Attribute\Parameter\Query; use Yiisoft\Router\HydratorAttribute\RouteArgument; -#[OA\Tag(name: "blog", description: "Blog")] -#[OA\Parameter(parameter: "PageRequest", name: "page", in: "query", schema: new OA\Schema(type: "int", example: "2"))] +#[OA\Tag(name: 'blog', description: 'Blog')] +#[OA\Parameter(parameter: 'PageRequest', name: 'page', in: 'query', schema: new OA\Schema(type: 'int', example: '2'))] final class BlogController { private DataResponseFactoryInterface $responseFactory; @@ -37,27 +37,29 @@ public function __construct( } #[OA\Get( - path: "/blog/", - description: "", - summary: "Returns paginated blog posts", - tags: ["blog"], + path: '/blog/', + description: '', + summary: 'Returns paginated blog posts', + tags: ['blog'], parameters: [ - new OA\Parameter(ref: '#/components/parameters/PageRequest') + new OA\Parameter(ref: '#/components/parameters/PageRequest'), ], responses: [ new OA\Response( - response:"200", - description:"Success", + response:'200', + description:'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", + property: 'data', properties: [ - new OA\Property(property: "posts", type: "array", items: new OA\Items(ref:"#/components/schemas/Post")), - new OA\Property(property: "paginator", ref: "#/components/schemas/Paginator", type: "object"), - ], type: "object"), + new OA\Property(property: 'posts', type: 'array', items: new OA\Items(ref:'#/components/schemas/Post')), + new OA\Property(property: 'paginator', ref: '#/components/schemas/Paginator', type: 'object'), + ], + type: 'object' + ), ]), ] ), @@ -81,39 +83,41 @@ public function index(PaginatorFormatter $paginatorFormatter, #[Query('page')] i } #[OA\Get( - path: "/blog/{id}", - description: "", - summary: "Returns a post with a given ID", - tags: ["blog"], + path: '/blog/{id}', + description: '', + summary: 'Returns a post with a given ID', + tags: ['blog'], parameters: [ - new OA\Parameter(parameter: "id", name: "id", in: "path", schema: new OA\Schema(type: "int", example: "2")) + new OA\Parameter(parameter: 'id', name: 'id', in: 'path', schema: new OA\Schema(type: 'int', example: '2')), ], responses: [ new OA\Response( - response:"200", - description:"Success", + response:'200', + description:'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", + property: 'data', properties: [ - new OA\Property(property: "post", ref: "#/components/schemas/Post", type: "object") - ], type: "object"), + new OA\Property(property: 'post', ref: '#/components/schemas/Post', type: 'object'), + ], + type: 'object' + ), ]), ] ), ), new OA\Response( - response: "404", - description: "Not found", + response: '404', + description: 'Not found', content: new OA\JsonContent(allOf: [ - new OA\Schema(ref: "#/components/schemas/BadResponse"), + new OA\Schema(ref: '#/components/schemas/BadResponse'), new OA\Schema(properties: [ - new OA\Property(property:"error_message", example:"Entity not found"), - new OA\Property(property: "error_code", example: 404, nullable: true) - ]) + new OA\Property(property:'error_message', example:'Entity not found'), + new OA\Property(property: 'error_code', example: 404, nullable: true), + ]), ]) ), ] @@ -130,26 +134,26 @@ public function view(#[RouteArgument('id')] int $id): Response } #[OA\Post( - path: "/blog/", - description: "", - summary: "Creates a blog post", + path: '/blog/', + description: '', + summary: 'Creates a blog post', security: [new OA\SecurityScheme(ref: '#/components/securitySchemes/ApiKey')], requestBody: new OA\RequestBody(required: true, content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/EditPostRequest"), + new OA\Schema(ref: '#/components/schemas/EditPostRequest'), ] )), - tags: ["blog"], + tags: ['blog'], responses: [ new OA\Response( - response: "200", - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Response") + response: '200', + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/Response') ), new OA\Response( - response: "400", - description: "Bad request", - content: new OA\JsonContent(ref: "#/components/schemas/BadResponse") + response: '400', + description: 'Bad request', + content: new OA\JsonContent(ref: '#/components/schemas/BadResponse') ), ] )] @@ -164,29 +168,29 @@ public function create(EditPostRequest $postRequest, UserRequest $userRequest): } #[OA\Put( - path: "/blog/{id}", - description: "", - summary: "Updates a blog post with a given ID", + path: '/blog/{id}', + description: '', + summary: 'Updates a blog post with a given ID', security: [new OA\SecurityScheme(ref: '#/components/securitySchemes/ApiKey')], requestBody: new OA\RequestBody(required: true, content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/EditPostRequest"), + new OA\Schema(ref: '#/components/schemas/EditPostRequest'), ] )), - tags: ["blog"], + tags: ['blog'], parameters: [ - new OA\Parameter(parameter: "id", name: "id", in: "path", schema: new OA\Schema(type: "int", example: "2")) + new OA\Parameter(parameter: 'id', name: 'id', in: 'path', schema: new OA\Schema(type: 'int', example: '2')), ], responses: [ new OA\Response( - response: "200", - description: "Success", - content: new OA\JsonContent(ref: "#/components/schemas/Response") + response: '200', + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/Response') ), new OA\Response( - response: "400", - description: "Bad request", - content: new OA\JsonContent(ref: "#/components/schemas/BadResponse") + response: '400', + description: 'Bad request', + content: new OA\JsonContent(ref: '#/components/schemas/BadResponse') ), ] )] diff --git a/blog-api/src/Blog/EditPostRequest.php b/blog-api/src/Blog/EditPostRequest.php index b9487536..f7f24838 100644 --- a/blog-api/src/Blog/EditPostRequest.php +++ b/blog-api/src/Blog/EditPostRequest.php @@ -15,12 +15,13 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "EditPostRequest", + schema: 'EditPostRequest', properties: [ - new OA\Property(property: 'title', type: "string", example: 'Title post'), - new OA\Property(property: 'text', type: "string", example: 'Text post'), - new OA\Property(property: 'status', type: "int", example: '1'), - ])] + new OA\Property(property: 'title', type: 'string', example: 'Title post'), + new OA\Property(property: 'text', type: 'string', example: 'Text post'), + new OA\Property(property: 'status', type: 'int', example: '1'), + ] +)] final class EditPostRequest extends AbstractInput implements RulesProviderInterface { #[RouteArgument('id')] diff --git a/blog-api/src/Blog/PostFormatter.php b/blog-api/src/Blog/PostFormatter.php index b5538208..db8d1bfe 100644 --- a/blog-api/src/Blog/PostFormatter.php +++ b/blog-api/src/Blog/PostFormatter.php @@ -7,12 +7,13 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "Post", + schema: 'Post', properties: [ - new OA\Property(property: 'id', type: "int", example: '100'), - new OA\Property(property: 'title', type: "string", example: 'Title'), - new OA\Property(property: 'content', type: "string", example: 'Text'), - ])] + new OA\Property(property: 'id', type: 'int', example: '100'), + new OA\Property(property: 'title', type: 'string', example: 'Title'), + new OA\Property(property: 'content', type: 'string', example: 'Text'), + ] +)] final class PostFormatter { public function format(Post $post): array diff --git a/blog-api/src/Dto/ApiResponseData.php b/blog-api/src/Dto/ApiResponseData.php index 92b777e3..114e934e 100644 --- a/blog-api/src/Dto/ApiResponseData.php +++ b/blog-api/src/Dto/ApiResponseData.php @@ -7,48 +7,48 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "Response" + schema: 'Response' )] #[OA\Schema( - schema: "BadResponse", + schema: 'BadResponse', allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ - new OA\Property(property: "status", example: "failed"), - new OA\Property(property: "error_message", example: "Error description message"), - new OA\Property(property: "error_code", example: "400", nullable: true), - new OA\Property(property: "data", example: null), - ]) + new OA\Property(property: 'status', example: 'failed'), + new OA\Property(property: 'error_message', example: 'Error description message'), + new OA\Property(property: 'error_code', example: '400', nullable: true), + new OA\Property(property: 'data', example: null), + ]), ] )] final class ApiResponseData { #[OA\Property( - property: "status", - format: "string", + property: 'status', + format: 'string', enum: ['success', 'failed'], - example: "success" + example: 'success' )] private string $status = ''; #[OA\Property( - property: "error_message", - format: "string", - example: "" + property: 'error_message', + format: 'string', + example: '' )] private string $errorMessage = ''; #[OA\Property( - property: "error_code", - format: "integer", + property: 'error_code', + format: 'integer', example: null, nullable: true )] private ?int $errorCode = null; #[OA\Property( - property: "data", - type: "object", + property: 'data', + type: 'object', nullable: true )] private ?array $data = null; diff --git a/blog-api/src/Formatter/PaginatorFormatter.php b/blog-api/src/Formatter/PaginatorFormatter.php index ca9ffa31..88266c18 100644 --- a/blog-api/src/Formatter/PaginatorFormatter.php +++ b/blog-api/src/Formatter/PaginatorFormatter.php @@ -8,12 +8,13 @@ use Yiisoft\Data\Paginator\OffsetPaginator; #[OA\Schema( - schema: "Paginator", + schema: 'Paginator', properties: [ - new OA\Property(property: 'pageSize', type: "int", example: '10'), - new OA\Property(property: 'currentPage', type: "int", example: '1'), - new OA\Property(property: 'totalPages', type: "int", example: '3'), - ])] + new OA\Property(property: 'pageSize', type: 'int', example: '10'), + new OA\Property(property: 'currentPage', type: 'int', example: '1'), + new OA\Property(property: 'totalPages', type: 'int', example: '3'), + ] +)] final class PaginatorFormatter { public function format(OffsetPaginator $paginator): array diff --git a/blog-api/src/InfoController.php b/blog-api/src/InfoController.php index c8c4ee27..5dbe11ff 100644 --- a/blog-api/src/InfoController.php +++ b/blog-api/src/InfoController.php @@ -8,7 +8,7 @@ use Psr\Http\Message\ResponseInterface; use Yiisoft\DataResponse\DataResponseFactoryInterface; -#[OA\Info(version: "1.0", title: "Yii API application")] +#[OA\Info(version: '1.0', title: 'Yii API application')] class InfoController { public function __construct(private VersionProvider $versionProvider) @@ -16,21 +16,21 @@ public function __construct(private VersionProvider $versionProvider) } #[OA\Get( - path: "/", - description: "", - summary: "Returns info about the API", + path: '/', + description: '', + summary: 'Returns info about the API', responses: [ new OA\Response( - response:"200", - description:"Success", + response:'200', + description:'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ - new OA\Property(property: "data", properties: [ - new OA\Property(property: "version", type: "string", example: "3.0"), - new OA\Property(property: "author", type: "string", example: "yiisoft"), - ], type: "object"), + new OA\Property(property: 'data', properties: [ + new OA\Property(property: 'version', type: 'string', example: '3.0'), + new OA\Property(property: 'author', type: 'string', example: 'yiisoft'), + ], type: 'object'), ]), ] ), diff --git a/blog-api/src/User/UserController.php b/blog-api/src/User/UserController.php index a2ed08b2..cbb63502 100644 --- a/blog-api/src/User/UserController.php +++ b/blog-api/src/User/UserController.php @@ -11,7 +11,7 @@ use Yiisoft\DataResponse\DataResponseFactoryInterface; use Yiisoft\Router\HydratorAttribute\RouteArgument; -#[OA\Tag(name: "user", description: "User")] +#[OA\Tag(name: 'user', description: 'User')] final class UserController { use RestControllerTrait; @@ -31,31 +31,33 @@ public function __construct( } #[OA\Get( - path: "/users/", - description: "", - summary: "Returns paginated users", + path: '/users/', + description: '', + summary: 'Returns paginated users', security: [new OA\SecurityScheme(ref: '#/components/securitySchemes/ApiKey')], - tags: ["user"], + tags: ['user'], responses: [ new OA\Response( - response: "200", - description: "Success", + response: '200', + description: 'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", + property: 'data', properties: [ new OA\Property( - property: "user", - type: "array", - items: new OA\Items(ref: "#/components/schemas/User") - ) + property: 'user', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/User') + ), ], - type: "object"), + type: 'object' + ), ]), - ]) + ] + ) ), ] )] @@ -75,30 +77,32 @@ public function list(): ResponseInterface } #[OA\Get( - path: "/users/{id}", - description: "", - summary: "Returns a user with a given ID", + path: '/users/{id}', + description: '', + summary: 'Returns a user with a given ID', security: [new OA\SecurityScheme(ref: '#/components/securitySchemes/ApiKey')], - tags: ["user"], + tags: ['user'], parameters: [ - new OA\Parameter(parameter: "id", name: "id", in: "path", example: 2) + new OA\Parameter(parameter: 'id', name: 'id', in: 'path', example: 2), ], responses: [ new OA\Response( - response: "200", - description: "Success", + response: '200', + description: 'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", + property: 'data', properties: [ - new OA\Property(property: "user", ref: "#/components/schemas/User", type: "object") + new OA\Property(property: 'user', ref: '#/components/schemas/User', type: 'object'), ], - type: "object"), + type: 'object' + ), ]), - ]) + ] + ) ), ] )] diff --git a/blog-api/src/User/UserFormatter.php b/blog-api/src/User/UserFormatter.php index 316e08e0..8a04fe59 100644 --- a/blog-api/src/User/UserFormatter.php +++ b/blog-api/src/User/UserFormatter.php @@ -7,11 +7,12 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "User", + schema: 'User', properties: [ - new OA\Property(property: 'login', type: "string", example: 'UserName'), - new OA\Property(property: 'created_at', type: "string", example: '13.12.2020 00:04:20'), - ])] + new OA\Property(property: 'login', type: 'string', example: 'UserName'), + new OA\Property(property: 'created_at', type: 'string', example: '13.12.2020 00:04:20'), + ] +)] final class UserFormatter { public function format(User $user): array diff --git a/blog/src/Controller/Actions/ApiInfo.php b/blog/src/Controller/Actions/ApiInfo.php index 152c92fe..f4e65c51 100644 --- a/blog/src/Controller/Actions/ApiInfo.php +++ b/blog/src/Controller/Actions/ApiInfo.php @@ -11,7 +11,7 @@ use Yiisoft\DataResponse\DataResponseFactoryInterface; use OpenApi\Attributes as OA; -#[OA\Info(version: "2.0", title: "Yii demo API")] +#[OA\Info(version: '2.0', title: 'Yii demo API')] final class ApiInfo implements MiddlewareInterface { private DataResponseFactoryInterface $responseFactory; @@ -22,21 +22,21 @@ public function __construct(DataResponseFactoryInterface $responseFactory) } #[OA\Get( - path: "/api/info/v2", - description: "", - summary: "Returns info about the API", + path: '/api/info/v2', + description: '', + summary: 'Returns info about the API', responses: [ new OA\Response( - response:"200", - description:"Success", + response:'200', + description:'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ - new OA\Property(property: "data", properties: [ - new OA\Property(property: "version", type: "string", example: "2.0"), - new OA\Property(property: "author", type: "string", example: "yiisoft"), - ], type: "object"), + new OA\Property(property: 'data', properties: [ + new OA\Property(property: 'version', type: 'string', example: '2.0'), + new OA\Property(property: 'author', type: 'string', example: 'yiisoft'), + ], type: 'object'), ]), ] ), diff --git a/blog/src/Middleware/ApiDataWrapper.php b/blog/src/Middleware/ApiDataWrapper.php index aca7686b..89793e30 100644 --- a/blog/src/Middleware/ApiDataWrapper.php +++ b/blog/src/Middleware/ApiDataWrapper.php @@ -12,11 +12,11 @@ use OpenApi\Attributes as OA; #[OA\Schema( - schema: "Response", + schema: 'Response', properties: [ - new OA\Property(property: "status", type: "string", enum: ["success", "failed"]), - new OA\Property(property: "error", type:"object", nullable: true), - new OA\Property(property: "data", type: "object", nullable: true), + new OA\Property(property: 'status', type: 'string', enum: ['success', 'failed']), + new OA\Property(property: 'error', type:'object', nullable: true), + new OA\Property(property: 'data', type: 'object', nullable: true), ] )] final class ApiDataWrapper implements MiddlewareInterface diff --git a/blog/src/User/Controller/ApiUserController.php b/blog/src/User/Controller/ApiUserController.php index 173d5dd7..ce43136d 100644 --- a/blog/src/User/Controller/ApiUserController.php +++ b/blog/src/User/Controller/ApiUserController.php @@ -12,7 +12,7 @@ use Yiisoft\Router\CurrentRoute; use OpenApi\Attributes as OA; -#[OA\Tag(name: "user", description: "User")] +#[OA\Tag(name: 'user', description: 'User')] final class ApiUserController { public function __construct(private DataResponseFactoryInterface $responseFactory) @@ -20,29 +20,30 @@ public function __construct(private DataResponseFactoryInterface $responseFactor } #[OA\Get( - path: "/api/user", - description: "", - summary: "Get users list", - tags: ["user"], + path: '/api/user', + description: '', + summary: 'Get users list', + tags: ['user'], responses: [ new OA\Response( - response: "200", - description: "Success", + response: '200', + description: 'Success', content: new OA\XmlContent( - xml: new OA\Xml(name: "response"), + xml: new OA\Xml(name: 'response'), allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ new OA\Property( - property: "data", - type: "array", + property: 'data', + type: 'array', items: new OA\Items(properties: [ - new OA\Property(property: "login", type: "string", example: "exampleLogin"), - new OA\Property(property: "created_at", type: "string", example: "13.12.2020 00:04:20"), + new OA\Property(property: 'login', type: 'string', example: 'exampleLogin'), + new OA\Property(property: 'created_at', type: 'string', example: '13.12.2020 00:04:20'), ]) ), ]), - ]) + ] + ) ), ] )] @@ -64,25 +65,25 @@ public function index(UserRepository $userRepository): ResponseInterface } #[OA\Get( - path: "/api/user/{login}", - description: "", - summary: "Get user info", - tags: ["user"], + path: '/api/user/{login}', + description: '', + summary: 'Get user info', + tags: ['user'], parameters: [ - new OA\Parameter(parameter: "login", name: "Login", in: "path") + new OA\Parameter(parameter: 'login', name: 'Login', in: 'path'), ], responses: [ new OA\Response( - response: "200", - description: "Success", + response: '200', + description: 'Success', content: new OA\JsonContent( allOf: [ - new OA\Schema(ref: "#/components/schemas/Response"), + new OA\Schema(ref: '#/components/schemas/Response'), new OA\Schema(properties: [ - new OA\Property(property: "data", properties: [ - new OA\Property(property: "login", type: "string", example: "exampleLogin"), - new OA\Property(property: "created_at", type: "string", example: "13.12.2020 00:04:20"), - ], type: "object"), + new OA\Property(property: 'data', properties: [ + new OA\Property(property: 'login', type: 'string', example: 'exampleLogin'), + new OA\Property(property: 'created_at', type: 'string', example: '13.12.2020 00:04:20'), + ], type: 'object'), ]), ] ),