Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

Commit

Permalink
Used \Some\Foo::class instead of '\Some\Foo' which type-safe and easi…
Browse files Browse the repository at this point in the history
…er to find by your editor/IDE

Signed-off-by: Roland Häder <roland@mxchange.org>
  • Loading branch information
Quix0r committed Oct 26, 2020
1 parent 9b4961e commit 193b01c
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions bin/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

(new \Friendica\Directory\Controllers\Cron(
$container->get('atlas'),
$container->get('\Friendica\Directory\Pollers\Profile'),
$container->get('\Friendica\Directory\Pollers\Server'),
$container->get('\Friendica\Directory\Pollers\Directory'),
$container->get(\Friendica\Directory\Pollers\Profile::class),
$container->get(\Friendica\Directory\Pollers\Server::class),
$container->get(\Friendica\Directory\Pollers\Directory::class),
$container->get('logger')
))->execute();

2 changes: 1 addition & 1 deletion src/classes/Routes/Console/DirectoryPoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(array $args)
{
return (new \Friendica\Directory\Controllers\Console\DirectoryPoll(
$this->container->get('atlas'),
$this->container->get('\Friendica\Directory\Pollers\Directory'),
$this->container->get(\Friendica\Directory\Pollers\Directory::class),
$args
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Console/ProfileAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ProfileAdd extends BaseRoute
public function __invoke(array $args)
{
return (new \Friendica\Directory\Controllers\Console\ProfileAdd(
$this->container->get('\Friendica\Directory\Models\ProfilePollQueue'),
$this->container->get(\Friendica\Directory\Models\ProfilePollQueue::class),
$args
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Console/ProfilePoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ProfilePoll extends BaseRoute
public function __invoke(array $args)
{
return (new \Friendica\Directory\Controllers\Console\ProfilePoll(
$this->container->get('\Friendica\Directory\Pollers\Profile'),
$this->container->get(\Friendica\Directory\Pollers\Profile::class),
$args
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Console/ServerHide.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(array $args)
{
return (new \Friendica\Directory\Controllers\Console\ServerHide(
$this->container->get('atlas'),
$this->container->get('\Friendica\Directory\Models\Server'),
$this->container->get(\Friendica\Directory\Models\Server::class),
$args
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Console/ServerPoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(array $args)
{
return (new \Friendica\Directory\Controllers\Console\ServerPoll(
$this->container->get('atlas'),
$this->container->get('\Friendica\Directory\Pollers\Server'),
$this->container->get(\Friendica\Directory\Pollers\Server::class),
$args
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Http/MatchSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $respo
{
return (new \Friendica\Directory\Controllers\Api\MatchSearch(
$this->container->atlas,
$this->container->get('\Friendica\Directory\Models\Profile'),
$this->container->get(\Friendica\Directory\Models\Profile::class),
$this->container->l10n
))->render($request, $response, $args);
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Http/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $respo
{
return (new \Friendica\Directory\Controllers\Api\Search(
$this->container->atlas,
$this->container->get('\Friendica\Directory\Models\Profile'),
$this->container->get(\Friendica\Directory\Models\Profile::class),
$this->container->l10n
))->render($request, $response, $args);
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Routes/Http/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $respo
{
return (new \Friendica\Directory\Controllers\Api\Submit(
$this->container->atlas,
$this->container->get('\Friendica\Directory\Models\ProfilePollQueue'),
$this->container->get(\Friendica\Directory\Models\ProfilePollQueue::class),
$this->container->logger
))->execute($request, $response);
}
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Routes/Web/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function __construct(\Slim\Container $container)

$this->controller = new \Friendica\Directory\Controllers\Web\Directory(
$this->container->atlas,
$this->container->get('\Friendica\Directory\Models\Profile'),
$this->container->get('\Friendica\Directory\Views\Widget\AccountTypeTabs'),
$this->container->get(\Friendica\Directory\Models\Profile::class),
$this->container->get(\Friendica\Directory\Views\Widget\AccountTypeTabs::class),
$this->container->renderer,
$this->container->l10n
);
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Routes/Web/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function __construct(\Slim\Container $container)

$this->controller = new \Friendica\Directory\Controllers\Web\Search(
$this->container->atlas,
$this->container->get('\Friendica\Directory\Models\Profile'),
$this->container->get('\Friendica\Directory\Views\Widget\AccountTypeTabs'),
$this->container->get(\Friendica\Directory\Models\Profile::class),
$this->container->get(\Friendica\Directory\Views\Widget\AccountTypeTabs::class),
$this->container->renderer,
$this->container->l10n
);
Expand Down
24 changes: 12 additions & 12 deletions src/dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,52 +91,52 @@

// Internal Dependency Injection

$container['\Friendica\Directory\Models\Profile'] = function (ContainerInterface $c): Friendica\Directory\Models\Profile {
$container[\Friendica\Directory\Models\Profile::class] = function (ContainerInterface $c): Friendica\Directory\Models\Profile {
return new Friendica\Directory\Models\Profile($c->get('atlas'));
};

$container['\Friendica\Directory\Models\ProfilePollQueue'] = function (ContainerInterface $c): Friendica\Directory\Models\ProfilePollQueue {
$container[\Friendica\Directory\Models\ProfilePollQueue::class] = function (ContainerInterface $c): Friendica\Directory\Models\ProfilePollQueue {
return new Friendica\Directory\Models\ProfilePollQueue($c->get('atlas'));
};

$container['\Friendica\Directory\Models\Server'] = function (ContainerInterface $c): Friendica\Directory\Models\Server {
$container[\Friendica\Directory\Models\Server::class] = function (ContainerInterface $c): Friendica\Directory\Models\Server {
return new Friendica\Directory\Models\Server($c->get('atlas'));
};

$container['\Friendica\Directory\Pollers\Directory'] = function (ContainerInterface $c): Friendica\Directory\Pollers\Directory {
$container[\Friendica\Directory\Pollers\Directory::class] = function (ContainerInterface $c): Friendica\Directory\Pollers\Directory {
$settings = $c->get('settings')['poller'];
return new Friendica\Directory\Pollers\Directory(
$c->get('atlas'),
$c->get('\Friendica\Directory\Models\ProfilePollQueue'),
$c->get(\Friendica\Directory\Models\ProfilePollQueue::class),
$c->get('logger'),
$settings ?: []
);
};

$container['\Friendica\Directory\Pollers\Profile'] = function (ContainerInterface $c): Friendica\Directory\Pollers\Profile {
$container[\Friendica\Directory\Pollers\Profile::class] = function (ContainerInterface $c): Friendica\Directory\Pollers\Profile {
$settings = $c->get('settings')['poller'];
return new Friendica\Directory\Pollers\Profile(
$c->get('atlas'),
$c->get('\Friendica\Directory\Models\Server'),
$c->get('\Friendica\Directory\Models\Profile'),
$c->get(\Friendica\Directory\Models\Server::class),
$c->get(\Friendica\Directory\Models\Profile::class),
$c->get('logger'),
$settings ?: []
);
};

$container['\Friendica\Directory\Pollers\Server'] = function (ContainerInterface $c): Friendica\Directory\Pollers\Server {
$container[\Friendica\Directory\Pollers\Server::class] = function (ContainerInterface $c): Friendica\Directory\Pollers\Server {
$settings = $c->get('settings')['poller'];
return new Friendica\Directory\Pollers\Server(
$c->get('atlas'),
$c->get('\Friendica\Directory\Models\ProfilePollQueue'),
$c->get('\Friendica\Directory\Models\Server'),
$c->get(\Friendica\Directory\Models\ProfilePollQueue::class),
$c->get(\Friendica\Directory\Models\Server::class),
$c->get('simplecache'),
$c->get('logger'),
$settings ?: []
);
};

$container['\Friendica\Directory\Views\Widget\AccountTypeTabs'] = function (ContainerInterface $c): Friendica\Directory\Views\Widget\AccountTypeTabs {
$container[\Friendica\Directory\Views\Widget\AccountTypeTabs::class] = function (ContainerInterface $c): Friendica\Directory\Views\Widget\AccountTypeTabs {
return new Friendica\Directory\Views\Widget\AccountTypeTabs(
$c->get('atlas'),
$c->get('renderer'),
Expand Down

0 comments on commit 193b01c

Please sign in to comment.