This commit is contained in:
2020-12-17 14:12:44 +08:00
parent 9516baef92
commit 33e5416dda
38 changed files with 100 additions and 101 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ namespace HttpServer\Http;
use Exception;
use HttpServer\Application;
use HttpServer\IInterface\AuthIdentity;
use JetBrains\PhpStorm\Pure;
use ReflectionException;
use Snowflake\Core\JSON;
use Snowflake\Exception\ComponentException;
@@ -186,7 +186,7 @@ class Request extends Application
/**
* @return string
*/
#[Pure] public function getCurrent(): string
public function getCurrent(): string
{
return current($this->explode);
}
@@ -360,7 +360,7 @@ class Request extends Application
/**
* @return mixed|null
*/
#[Pure] public function getIp()
public function getIp()
{
$headers = $this->headers->getHeaders();
if (!empty($headers['x-forwarded-for'])) return $headers['x-forwarded-for'];
@@ -372,7 +372,7 @@ class Request extends Application
/**
* @return string
*/
#[Pure] public function getRuntime(): string
public function getRuntime(): string
{
return sprintf('%.5f', microtime(TRUE) - $this->startTime);
}