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

Feedbacks::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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