UserSession class [5] - Refactor src/Module/ files with DI

This commit is contained in:
Philipp 2022-10-20 22:59:12 +02:00
parent a729f3255d
commit eecc456e0c
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
78 changed files with 455 additions and 530 deletions

View file

@ -21,7 +21,6 @@
namespace Friendica\Module\Events;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@ -36,7 +35,7 @@ class Json extends \Friendica\BaseModule
{
protected function rawContent(array $request = [])
{
if (!Session::getLocalUser()) {
if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\UnauthorizedException();
}
@ -70,9 +69,9 @@ class Json extends \Friendica\BaseModule
// get events by id or by date
if ($event_params['event_id']) {
$r = Event::getListById(Session::getLocalUser(), $event_params['event_id']);
$r = Event::getListById(DI::userSession()->getLocalUserId(), $event_params['event_id']);
} else {
$r = Event::getListByDate(Session::getLocalUser(), $event_params);
$r = Event::getListByDate(DI::userSession()->getLocalUserId(), $event_params);
}
$links = [];