diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-11 16:45:32 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-05-11 23:28:37 +0200 |
commit | a392cd70fbdc0d73a4e2ef84340b58dcd711f535 (patch) | |
tree | 30abe8b60f563d57f677ab7533159ef5e15ec4c9 /lib/private/Files/AppData | |
parent | 5a0b28d603e142051967175f023b698ff7e262db (diff) | |
download | nextcloud-server-a392cd70fbdc0d73a4e2ef84340b58dcd711f535.tar.gz nextcloud-server-a392cd70fbdc0d73a4e2ef84340b58dcd711f535.zip |
Make it possible to get the appdata folder using the public API
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Files/AppData')
-rw-r--r-- | lib/private/Files/AppData/Factory.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/private/Files/AppData/Factory.php b/lib/private/Files/AppData/Factory.php index 6d7483158f6..03f8fdedcbd 100644 --- a/lib/private/Files/AppData/Factory.php +++ b/lib/private/Files/AppData/Factory.php @@ -27,17 +27,16 @@ declare(strict_types=1); namespace OC\Files\AppData; use OC\SystemConfig; +use OCP\Files\AppData\IAppDataFactory; +use OCP\Files\IAppData; use OCP\Files\IRootFolder; -class Factory { +class Factory implements IAppDataFactory { + private IRootFolder $rootFolder; + private SystemConfig $config; - /** @var IRootFolder */ - private $rootFolder; - - /** @var SystemConfig */ - private $config; - - private $folders = []; + /** @var array<string, IAppData> */ + private array $folders = []; public function __construct(IRootFolder $rootFolder, SystemConfig $systemConfig) { @@ -45,11 +44,7 @@ class Factory { $this->config = $systemConfig; } - /** - * @param string $appId - * @return AppData - */ - public function get(string $appId): AppData { + public function get(string $appId): IAppData { if (!isset($this->folders[$appId])) { $this->folders[$appId] = new AppData($this->rootFolder, $this->config, $appId); } |