Completed
Push — master ( f93802...a3beff )
by Paweł
34:14
created

ResponseContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Core Bundle.
7
 *
8
 * Copyright 2016 Sourcefabric z.u. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2016 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Component\Common\Response;
18
19
class ResponseContext implements ResponseContextInterface
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $intention;
25
26
    /**
27
     * @var int
28
     */
29
    protected $statusCode;
30
31
    /**
32
     * ResponseContext constructor.
33
     *
34
     * @param string $intention
35
     * @param int    $statusCode
36
     */
37 57
    public function __construct(int $statusCode = 200, string $intention = self::INTENTION_API)
38
    {
39 57
        $this->intention = $intention;
40 57
        $this->statusCode = $statusCode;
41 57
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 49
    public function getIntention(): string
47
    {
48 49
        return $this->intention;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 49
    public function getStatusCode(): int
55
    {
56 49
        return $this->statusCode;
57
    }
58
}
59