Test Failed
Pull Request — master (#87)
by Dmitriy
02:46
created

Action   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\IO\Http\Home\GetIndex;
6
7
use OpenApi\Annotations as OA;
8
use Psr\Http\Message\ResponseInterface;
9
use Yiisoft\DataResponse\DataResponseFactoryInterface;
10
11
/**
12
 * @OA\Info(title="Yii API application", version="1.0")
13
 *
14
 * @OA\Get(
15
 *     path="/",
16
 *     summary="Returns info about the API",
17
 *     description="",
18
 *     @OA\Response(
19
 *          response="200",
20
 *          description="Success",
21
 *          @OA\JsonContent(
22
 *              allOf={
23
 *                  @OA\Schema(ref="#/components/schemas/Response"),
24
 *                  @OA\Schema(
25
 *                      @OA\Property(
26
 *                          property="data",
27
 *                          type="object",
28
 *                          @OA\Property(
29
 *                              property="version",
30
 *                              type="string",
31
 *                              example="3.0"
32
 *                          ),
33
 *                          @OA\Property(
34
 *                              property="author",
35
 *                              type="string",
36
 *                              example="yiisoft"
37
 *                          ),
38
 *                      ),
39
 *                  ),
40
 *              },
41
 *          )
42
 *    ),
43
 * )
44
 */
45
final class Action
46
{
47
    public function __invoke(DataResponseFactoryInterface $responseFactory): ResponseInterface
48
    {
49
        return $responseFactory->createResponse([
50
            'version' => '3.0',
51
            'author' => 'yiisoft',
52
        ]);
53
    }
54
}
55