Completed
Push — master ( e43f1a...57db71 )
by Arman
26s queued 12s
created

Url   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 8
eloc 13
c 1
b 1
f 0
dl 0
loc 97
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setProtocol() 0 3 1
A getPort() 0 3 1
A setPort() 0 3 1
A getHost() 0 3 1
A setUri() 0 3 1
A getProtocol() 0 3 1
A setHost() 0 3 1
A getUri() 0 3 1
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.4.0
13
 */
14
15
namespace Quantum\Http\Request;
16
17
/**
18
 * Trait Url
19
 * @package Quantum\Http\Request
20
 */
21
trait Url
22
{
23
24
    /**
25
     * Scheme
26
     * @var string
27
     */
28
    private static $__protocol = null;
29
30
    /**
31
     * Host name
32
     * @var string
33
     */
34
    private static $__host = null;
35
36
    /**
37
     * Server port
38
     * @var string
39
     */
40
    private static $__port = null;
41
42
    /**
43
     * Request URI
44
     * @var string
45
     */
46
    private static $__uri = null;
47
48
    /**
49
     * Gets the protocol
50
     * @return string
51
     */
52
    public static function getProtocol(): ?string
53
    {
54
        return self::$__protocol;
55
    }
56
57
    /**
58
     * Sets the protocol
59
     * @param string $protocol
60
     */
61
    public static function setProtocol(string $protocol)
62
    {
63
        self::$__protocol = $protocol;
64
    }
65
66
    /**
67
     * Gets the host name
68
     * @return string
69
     */
70
    public static function getHost(): ?string
71
    {
72
        return self::$__host;
73
    }
74
75
    /**
76
     * Sets the host name
77
     * @param string $host
78
     */
79
    public static function setHost(string $host)
80
    {
81
        self::$__host = $host;
82
    }
83
84
    /**
85
     * Gets the port
86
     * @return string
87
     */
88
    public static function getPort(): ?string
89
    {
90
        return self::$__port;
91
    }
92
93
    /**
94
     * Sets the port
95
     * @param string $port
96
     */
97
    public static function setPort(string $port)
98
    {
99
        self::$__port = $port;
100
    }
101
102
    /**
103
     * Gets the URI
104
     * @return string|null
105
     */
106
    public static function getUri(): ?string
107
    {
108
        return self::$__uri;
109
    }
110
111
    /**
112
     * Sets the URI
113
     * @param string $uri
114
     */
115
    public static function setUri(string $uri)
116
    {
117
        self::$__uri = ltrim($uri, '/');
118
    }
119
120
}