Skip to content

Commit

Permalink
Removed interfaces from constructor.
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Parker <joshua@joshuaparker.dev>
  • Loading branch information
nomadicjosh committed Sep 4, 2024
1 parent 9c6249b commit 5528aa0
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions Http/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Codefy\Framework\Contracts\RoutingController;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Qubus\Http\Session\SessionService;
use Qubus\Routing\Controller\Controller;
use Qubus\Routing\Router;
Expand All @@ -19,58 +18,12 @@ class BaseController extends Controller implements RoutingController
{
public function __construct(
protected SessionService $sessionService,
protected ServerRequestInterface $request,
protected ResponseInterface $response,
protected Router $router,
protected ?Renderer $view = null,
) {
$this->setView(view: $view ?? new NativeLoader(config('view.path')));
}

/**
* Gets the request instance.
*
* @return ServerRequestInterface
*/
public function getRequest(): ServerRequestInterface
{
return $this->request;
}

/**
* Set the request instance.
*
* @param ServerRequestInterface $request
* @return BaseController
*/
public function setRequest(ServerRequestInterface $request): self
{
$this->request = $request;

return $this;
}

/**
* Gets the response instance.
*
* @return ResponseInterface
*/
public function getResponse(): ResponseInterface
{
return $this->response;
}

/**
* @param ResponseInterface $response
* @return BaseController
*/
public function setResponse(ResponseInterface $response): self
{
$this->response = $response;

return $this;
}

/**
* Gets the view instance.
*
Expand Down

0 comments on commit 5528aa0

Please sign in to comment.