Compare commits
No commits in common. "bf4520a7dd400e0c47e21169c6e4e01c1fccf836" and "ba33a9bb37ff2208912abdd1c12e080efd75c6d2" have entirely different histories.
bf4520a7dd
...
ba33a9bb37
@ -12,8 +12,6 @@ interface IRequest
|
|||||||
|
|
||||||
public function post(string $key);
|
public function post(string $key);
|
||||||
|
|
||||||
public function header(string $key);
|
|
||||||
|
|
||||||
public function session(): ISession;
|
public function session(): ISession;
|
||||||
|
|
||||||
public function setUser(?IUser $user): void;
|
public function setUser(?IUser $user): void;
|
||||||
|
@ -15,24 +15,15 @@ class Request implements IRequest
|
|||||||
|
|
||||||
private array $post;
|
private array $post;
|
||||||
|
|
||||||
private array $headers;
|
|
||||||
|
|
||||||
private Session $session;
|
private Session $session;
|
||||||
|
|
||||||
private ?IUser $user = null;
|
private ?IUser $user = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(string $base, array &$get, array &$post, array &$session, IUserRepository $userRepository)
|
||||||
string $base,
|
|
||||||
array &$get,
|
|
||||||
array &$post,
|
|
||||||
array $headers,
|
|
||||||
array &$session,
|
|
||||||
IUserRepository $userRepository)
|
|
||||||
{
|
{
|
||||||
$this->base = $base;
|
$this->base = $base;
|
||||||
$this->get = &$get;
|
$this->get = &$get;
|
||||||
$this->post = &$post;
|
$this->post = &$post;
|
||||||
$this->headers = $headers;
|
|
||||||
$this->session = new Session($session);
|
$this->session = new Session($session);
|
||||||
|
|
||||||
$userId = $this->session->get('userId');
|
$userId = $this->session->get('userId');
|
||||||
@ -73,15 +64,6 @@ class Request implements IRequest
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function header($key)
|
|
||||||
{
|
|
||||||
if (isset($this->headers[$key])) {
|
|
||||||
return $this->headers[$key];
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function session(): ISession
|
public function session(): ISession
|
||||||
{
|
{
|
||||||
return $this->session;
|
return $this->session;
|
||||||
|
Loading…
Reference in New Issue
Block a user