Completed
Pull Request — master (#444)
by Raffael
05:17
created

Feedbacks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A post() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * balloon
7
 *
8
 * @copyright   Copryright (c) 2012-2019 gyselroth GmbH (https://gyselroth.com)
9
 * @license     GPL-3.0 https://opensource.org/licenses/GPL-3.0
10
 */
11
12
namespace Balloon\App\Feedback\Api\v2;
13
14
use Balloon\App\Feedback\Feedback as FeedbackHandler;
15
use Micro\Http\Response;
16
17
class Feedbacks
18
{
19
    /**
20
     * Feedback.
21
     *
22
     * @var FeedbackHandler
23
     */
24
    protected $feedback_handler;
25
26
    /**
27
     * Initialize.
28
     */
29
    public function __construct(FeedbackHandler $feedback_handler)
30
    {
31
        $this->feedback_handler = $feedback_handler;
32
    }
33
34
    /**
35
     * Post feedback.
36
     */
37
    public function post(): Response
38
    {
39
        $this->feedback_handler->handle();
40
41
        return (new Response())->setCode(201);
42
    }
43
}
44