Skip to content

Commit

Permalink
refactor: Clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Sep 27, 2024
1 parent 019838a commit 834e3df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 40 deletions.
14 changes: 4 additions & 10 deletions lib/Settings/Personal/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,23 @@
use OCP\Settings\IIconSection;

class Section implements IIconSection {
/** @var IURLGenerator */
private $url;
/** @var IL10N */
private $l;

public function __construct(
IURLGenerator $url,
IL10N $l,
private IURLGenerator $urlGenerator,
private IL10N $l10n,
) {
$this->url = $url;
$this->l = $l;
}

public function getIcon(): string {
return $this->url->imagePath(Application::APP_ID, 'app-dark.svg');
return $this->urlGenerator->imagePath(Application::APP_ID, 'app-dark.svg');
}

public function getID(): string {
return 'migration';
}

public function getName(): string {
return $this->l->t('Data migration');
return $this->l10n->t('Data migration');
}

public function getPriority(): int {
Expand Down
30 changes: 0 additions & 30 deletions lib/Settings/Personal/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,9 @@

use OCA\UserMigration\AppInfo\Application;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IUser;
use OCP\IUserSession;
use OCP\Settings\ISettings;

class Settings implements ISettings {
/** @var IConfig */
private $serverConfig;
/** @var IInitialState */
private $initialState;
/** @var ICacheFactory */
private $memcacheFactory;
/** @var IUser */
private $currentUser;
/** @var IL10N */
private $l10n;

public function __construct(
IConfig $serverConfig,
IInitialState $initialState,
ICacheFactory $memcacheFactory,
IUserSession $userSession,
IL10N $l10n,
) {
$this->serverConfig = $serverConfig;
$this->initialState = $initialState;
$this->memcacheFactory = $memcacheFactory;
$this->currentUser = $userSession->getUser();
$this->l10n = $l10n;
}

public function getForm(): TemplateResponse {
return new TemplateResponse(Application::APP_ID, 'settings/personal/settings');
Expand Down

0 comments on commit 834e3df

Please sign in to comment.