Completed
Push — 4.0 ( 2ca4e1...0c3d7c )
by Marco
15:24
created

Model::cookies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Comodojo\Dispatcher\Response;
2
3
use \Comodojo\Dispatcher\Components\Model as DispatcherClassModel;
4
use \Comodojo\Dispatcher\Components\Configuration;
5
use \Comodojo\Dispatcher\Response\Headers;
6
use \Comodojo\Dispatcher\Response\Status;
7
use \Comodojo\Dispatcher\Response\Content;
8
use \Comodojo\Dispatcher\Response\Location;
9
use \Comodojo\Cookies\CookieManager;
10
use \Monolog\Logger;
11
12
/**
13
 * @package     Comodojo Dispatcher
14
 * @author      Marco Giovinazzi <[email protected]>
15
 * @author      Marco Castiello <[email protected]>
16
 * @license     GPL-3.0+
17
 *
18
 * LICENSE:
19
 *
20
 * This program is free software: you can redistribute it and/or modify
21
 * it under the terms of the GNU Affero General Public License as
22
 * published by the Free Software Foundation, either version 3 of the
23
 * License, or (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU Affero General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU Affero General Public License
31
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
 */
33
34
class Model extends DispatcherClassModel {
35
36
    private $headers;
37
38
    private $cookies;
39
40
    private $status;
41
42
    private $content;
43
44
    private $location;
45
46
    private $content_type = "text/plain";
0 ignored issues
show
Unused Code introduced by
The property $content_type is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
47
48
    private $charset;
0 ignored issues
show
Unused Code introduced by
The property $charset is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
49
50
    public function __construct(Configuration $configuration, Logger $logger) {
51
52
        parent::__construct($configuration, $logger);
53
54
        $this->headers = new Headers();
55
56
        $this->cookies = new CookieManager();
57
58
        $this->status = new Status();
59
60
        $this->content = new Content();
61
62
        $this->location = new Location();
63
64
    }
65
66
    public function headers() {
67
68
        return $this->headers;
69
70
    }
71
72
    public function cookies() {
73
74
        return $this->cookies;
75
76
    }
77
78
    public function status() {
79
80
        return $this->status;
81
82
    }
83
84
    public function content() {
85
86
        return $this->content;
87
88
    }
89
90
    public function location() {
91
92
        return $this->location;
93
94
    }
95
96
}
97