Passed
Push — master ( 76d3e9...73f345 )
by Radu
01:24
created

Request::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
namespace WebServCo\Framework\Libraries;
3
4
final class Request extends \WebServCo\Framework\AbstractLibrary
5
{
6
    /**
7
     * Sanitized _SERVER data.
8
     */
9
    protected $server = [];
10
    /**
11
     * Request method.
12
     */
13
    protected $method;
14
    /**
15
     * Current script filename. Should most commonly be index.php
16
     */
17
    protected $filename;
18
    /**
19
     * Script path.
20
     * For HTTP requests this will be public web server subdirectory
21
     * the project is located in.
22
     * For CLI request this will be the script path
23
     * (full or relative, depending on how the script was called).
24
     */
25
    protected $path = '';
26
    /**
27
     * Sanitized Framework customized target path.
28
     */
29
    protected $target = '';
30
    /**
31
     * Sanitized request query.
32
     */
33
    protected $query = [];
34
    /**
35
     * Sanitized Framework customized CLI arguments.
36
     *
37
     * Excludes the script name and the second argument
38
     * which is the Framework customized target path.
39
     */
40
    protected $args = [];
41
    
42
    use \WebServCo\Framework\Traits\RequestProcessTrait;
43
    use \WebServCo\Framework\Traits\RequestServerTrait;
44
    use \WebServCo\Framework\Traits\RequestUrlTrait;
45
     
46
    public function __construct($config, $server, $post = [])
47
    {
48
        parent::__construct($config);
49
        
50
        $this->init($server, $post);
51
    }
52
    
53
    public function getQuery()
54
    {
55
        return $this->query;
56
    }
57
    
58
    public function getTarget()
59
    {
60
        return $this->target;
61
    }
62
    
63
    public function getArgs()
64
    {
65
        return $this->args;
66
    }
67
}
68