<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica;
use Dice\Dice;
+use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Navigation\SystemMessages;
use Psr\Log\LoggerInterface;
/**
/**
* @return Database\Database
*/
- public static function dba()
+ public static function dba(): Database\Database
{
return self::$dice->create(Database\Database::class);
}
+ /**
+ * @return \Friendica\Database\Definition\DbaDefinition
+ */
+ public static function dbaDefinition(): Database\Definition\DbaDefinition
+ {
+ return self::$dice->create(Database\Definition\DbaDefinition::class);
+ }
+
+ /**
+ * @return \Friendica\Database\Definition\ViewDefinition
+ */
+ public static function viewDefinition(): Database\Definition\ViewDefinition
+ {
+ return self::$dice->create(Database\Definition\ViewDefinition::class);
+ }
+
//
// "App" namespace instances
//
return self::$dice->create(App\Mode::class);
}
- /**
- * @return App\Module
- */
- public static function module()
- {
- return self::$dice->create(App\Module::class);
- }
-
/**
* @return App\Page
*/
}
/**
- * @return Core\Process
+ * @return Core\Worker\Repository\Process
*/
public static function process()
{
- return self::$dice->create(Core\Process::class);
+ return self::$dice->create(Core\Worker\Repository\Process::class);
}
- /**
- * @return Core\Session\Capability\IHandleSessions
- */
- public static function session()
+ public static function session(): IHandleSessions
{
return self::$dice->create(Core\Session\Capability\IHandleSessions::class);
}
+ public static function userSession(): IHandleUserSessions
+ {
+ return self::$dice->create(Core\Session\Capability\IHandleUserSessions::class);
+ }
+
/**
* @return \Friendica\Core\Storage\Repository\StorageManager
*/
return self::$dice->create(Core\Storage\Repository\StorageManager::class);
}
+ /**
+ * @return \Friendica\Core\System
+ */
+ public static function system()
+ {
+ return self::$dice->create(Core\System::class);
+ }
+
+ /**
+ * @return \Friendica\Navigation\SystemMessages
+ */
+ public static function sysmsg()
+ {
+ return self::$dice->create(SystemMessages::class);
+ }
+
//
// "LoggerInterface" instances
//
+ /**
+ * Flushes the Logger instance, so the factory is called again
+ * (creates a new id and retrieves the current PID)
+ */
+ public static function flushLogger()
+ {
+ $flushDice = self::$dice
+ ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class))
+ ->addRule('$devLogger', self::$dice->getRule('$devLogger'));
+ static::init($flushDice);
+ }
+
/**
* @return LoggerInterface
*/
return self::$dice->create(Factory\Api\Mastodon\FollowRequest::class);
}
+ /**
+ * @return Factory\Api\Mastodon\Poll
+ */
+ public static function mstdnPoll()
+ {
+ return self::$dice->create(Factory\Api\Mastodon\Poll::class);
+ }
+
/**
* @return Factory\Api\Mastodon\Relationship
*/
return self::$dice->create(Factory\Api\Mastodon\Notification::class);
}
+ /**
+ * @return Factory\Api\Twitter\Status
+ */
+ public static function twitterStatus()
+ {
+ return self::$dice->create(Factory\Api\Twitter\Status::class);
+ }
+
/**
* @return Factory\Api\Twitter\User
*/
// "Model" namespace instances
//
/**
- * @return Model\Process
+ * @return \Friendica\Core\Worker\Repository\Process
*/
public static function modelProcess()
{
- return self::$dice->create(Model\Process::class);
+ return self::$dice->create(Core\Worker\Repository\Process::class);
}
/**
return self::$dice->create(Model\Log\ParsedLogIterator::class);
}
+ //
+ // "Module" namespace
+ //
+
+ public static function apiResponse(): Module\Api\ApiResponse
+ {
+ return self::$dice->create(Module\Api\ApiResponse::class);
+ }
+
//
// "Network" namespace
//
return self::$dice->create(Contact\Introduction\Factory\Introduction::class);
}
+ public static function localRelationship(): Contact\LocalRelationship\Repository\LocalRelationship
+ {
+ return self::$dice->create(Contact\LocalRelationship\Repository\LocalRelationship::class);
+ }
+
public static function permissionSet(): Security\PermissionSet\Repository\PermissionSet
{
return self::$dice->create(Security\PermissionSet\Repository\PermissionSet::class);
return self::$dice->create(Navigation\Notifications\Factory\Notify::class);
}
- public static function formattedNotificationFactory(): Navigation\Notifications\Factory\FormattedNotification
+ public static function formattedNotificationFactory(): Navigation\Notifications\Factory\FormattedNotify
+ {
+ return self::$dice->create(Navigation\Notifications\Factory\FormattedNotify::class);
+ }
+
+ public static function formattedNavNotificationFactory(): Navigation\Notifications\Factory\FormattedNavNotification
{
- return self::$dice->create(Navigation\Notifications\Factory\FormattedNotification::class);
+ return self::$dice->create(Navigation\Notifications\Factory\FormattedNavNotification::class);
}
//