Completed
Branch dev (d5d70c)
by Raffael
11:00
created

Api   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
dl 0
loc 34
rs 10
c 0
b 0
f 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * balloon
7
 *
8
 * @copyright   Copryright (c) 2012-2018 gyselroth GmbH (https://gyselroth.com)
9
 * @license     GPL-3.0 https://opensource.org/licenses/GPL-3.0
10
 */
11
12
namespace Balloon\App\Api\v2;
13
14
use Balloon\App\Api\Controller;
15
use Micro\Http\Response;
16
17
class Api extends Controller
18
{
19
    /**
20
     * @api {get} / Server & API Status
21
     * @apiVersion 2.0.0
22
     * @apiName get
23
     * @apiGroup Api
24
     * @apiPermission none
25
     * @apiDescription Get server time and api status/version
26
     *
27
     * @apiExample Example usage:
28
     * curl -XGET "https://SERVER/api/v2?pretty"
29
     *
30
     * @apiSuccess {string} name balloon identifier
31
     * @apiSuccess {number} api_version API Version
32
     * @apiSuccessExample {json} Success-Response:
33
     * HTTP/1.1 200 OK
34
     * {
35
     *      "name": "balloon",
36
     *      "api_version": 2
37
     * }
38
     *
39
     * @return Response
40
     */
41
    public function get(): Response
42
    {
43
        $data = [
44
            'name' => 'balloon',
45
            'api_version' => 2,
46
        ];
47
48
        return (new Response())->setCode(200)->setBody($data);
49
    }
50
}
51