| Total Complexity | 8 |
| Total Lines | 97 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 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) |
||
| 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 |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Sets the port |
||
| 95 | * @param string $port |
||
| 96 | */ |
||
| 97 | public static function setPort(string $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) |
||
| 118 | } |
||
| 119 | |||
| 120 | } |