Completed
Push — master ( 7d4b49...c115fe )
by Andreas
26:15 queued 26:15
created

midcom_response   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 37
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set_data() 0 3 1
A __set() 0 3 1
A __get() 0 3 1
1
<?php
2
/**
3
 * @package midcom
4
 * @author CONTENT CONTROL http://www.contentcontrol-berlin.de/
5
 * @copyright CONTENT CONTROL http://www.contentcontrol-berlin.de/
6
 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
7
 */
8
9
use Symfony\Component\HttpFoundation\Response;
10
11
/**
12
 * Wrapper for HTTP responses
13
 *
14
 * @package midcom
15
 */
16
class midcom_response extends Response
17
{
18
    /**
19
     * Character encoding to use
20
     *
21
     * @todo determine on the fly?
22
     * @var string Character encoding
23
     */
24
    public $encoding = 'UTF-8';
25
26
    /**
27
     * Response code to use
28
     *
29
     * @var int HTTP response code
30
     */
31
    public $code = MIDCOM_ERROK;
32
33
    /**
34
     * The data to be transmitted
35
     *
36
     * @var array
37
     */
38
    public $_data = [];
39
40
    public function __get($name)
41
    {
42
        return $this->_data[$name] ?? null;
43
    }
44
45
    public function __set($name, $value)
46
    {
47
        $this->_data[$name] = $value;
48
    }
49
50
    public function set_data($data)
51
    {
52
        $this->_data = $data;
53
    }
54
}
55