mirror of
https://github.com/friendica/friendica
synced 2025-01-18 13:44:28 +00:00
Refactor App::fromDice()
This commit is contained in:
parent
9e4f39b4fb
commit
0ab9c23bb9
1 changed files with 14 additions and 39 deletions
53
src/App.php
53
src/App.php
|
@ -55,20 +55,7 @@ class App
|
||||||
|
|
||||||
public static function fromDice(Dice $dice): self
|
public static function fromDice(Dice $dice): self
|
||||||
{
|
{
|
||||||
return new self(
|
return new self($dice);
|
||||||
$dice,
|
|
||||||
$dice->create(Request::class),
|
|
||||||
$dice->create(Authentication::class),
|
|
||||||
$dice->create(IManageConfigValues::class),
|
|
||||||
$dice->create(Mode::class),
|
|
||||||
$dice->create(BaseURL::class),
|
|
||||||
$dice->create(LoggerInterface::class),
|
|
||||||
$dice->create(Profiler::class),
|
|
||||||
$dice->create(L10n::class),
|
|
||||||
$dice->create(Arguments::class),
|
|
||||||
$dice->create(IHandleUserSessions::class),
|
|
||||||
$dice->create(AppHelper::class)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,32 +114,20 @@ class App
|
||||||
*/
|
*/
|
||||||
private $appHelper;
|
private $appHelper;
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(Dice $container)
|
||||||
Dice $container,
|
{
|
||||||
Request $request,
|
|
||||||
Authentication $auth,
|
|
||||||
IManageConfigValues $config,
|
|
||||||
Mode $mode,
|
|
||||||
BaseURL $baseURL,
|
|
||||||
LoggerInterface $logger,
|
|
||||||
Profiler $profiler,
|
|
||||||
L10n $l10n,
|
|
||||||
Arguments $args,
|
|
||||||
IHandleUserSessions $session,
|
|
||||||
AppHelper $appHelper,
|
|
||||||
) {
|
|
||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
$this->requestId = $request->getRequestId();
|
$this->requestId = $this->container->create(Request::class)->getRequestId();
|
||||||
$this->auth = $auth;
|
$this->auth = $this->container->create(Authentication::class);
|
||||||
$this->config = $config;
|
$this->config = $this->container->create(IManageConfigValues::class);
|
||||||
$this->mode = $mode;
|
$this->mode = $this->container->create(Mode::class);
|
||||||
$this->baseURL = $baseURL;
|
$this->baseURL = $this->container->create(BaseURL::class);
|
||||||
$this->profiler = $profiler;
|
$this->logger = $this->container->create(LoggerInterface::class);
|
||||||
$this->logger = $logger;
|
$this->profiler = $this->container->create(Profiler::class);
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $this->container->create(L10n::class);
|
||||||
$this->args = $args;
|
$this->args = $this->container->create(Arguments::class);
|
||||||
$this->session = $session;
|
$this->session = $this->container->create(IHandleUserSessions::class);
|
||||||
$this->appHelper = $appHelper;
|
$this->appHelper = $this->container->create(AppHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processRequest(ServerRequestInterface $request, float $start_time): void
|
public function processRequest(ServerRequestInterface $request, float $start_time): void
|
||||||
|
|
Loading…
Reference in a new issue