Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud 31 compatibility and some code cleanup #1056

Merged
merged 5 commits into from
Feb 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: Move to constructor property promotion
Signed-off-by: Julius Knorr <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Jan 20, 2025
commit da7c15c89aec37072dbb0e1dcfb5c8e1ea385441
45 changes: 9 additions & 36 deletions lib/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,14 @@
use OCP\ICacheFactory;
use OCP\IConfig;
use Psr\Log\LoggerInterface;
use OCA\Onlyoffice\AppInfo\Application;

/**
* Application configutarion
*
* @package OCA\Onlyoffice
*/
class AppConfig {

/**
* Application name
*
* @var string
*/
private $appName;

/**
* Config service
*
* @var IConfig
*/
private $config;

/**
* Logger
*
* @var LoggerInterface
*/
private $logger;

/**
* The config key for the demo server
*
Expand Down Expand Up @@ -361,22 +340,16 @@ class AppConfig {

/**
* The config key for store cache
*
* @var ICache
*/
private $cache;

/**
* @param string $AppName - application name
*/
public function __construct($AppName) {

$this->appName = $AppName;
private ICache $cache;

$this->config = \OC::$server->getConfig();
$this->logger = \OCP\Server::get(LoggerInterface::class);
$cacheFactory = \OCP\Server::get(ICacheFactory::class);
$this->cache = $cacheFactory->createLocal($this->appName);
public function __construct(
private string $appName,
private IConfig $config,
private LoggerInterface $logger,
ICacheFactory $cacheFactory,
) {
$this->cache = $cacheFactory->createLocal(Application::APP_ID);
}

/**
Expand Down
Loading