Passed
Push — master ( ca838e...76d3e9 )
by Radu
01:16
created

Request::getSchema()   B

Complexity

Conditions 8
Paths 5

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 8
eloc 11
nc 5
nop 0
dl 0
loc 16
rs 7.7777
c 0
b 0
f 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 getTarget()
54
    {
55
        return $this->target;
56
    }
57
    
58
    public function getArgs()
59
    {
60
        return $this->args;
61
    }
62
}
63