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

ResponseContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getIntention() 0 4 1
A getStatusCode() 0 4 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