mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
refactor: Move initialization of attributes to constructor
This makes the code more consistent with stable33 and later. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
b3bcd49a6c
commit
f47db8ca3d
1 changed files with 3 additions and 7 deletions
|
|
@ -45,6 +45,9 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
|
|||
private ?IGroupManager $groupManager,
|
||||
) {
|
||||
parent::__construct($carddavBackend, $principalUri);
|
||||
|
||||
$this->l10n = Util::getL10N('dav');
|
||||
$this->config = Server::get(IConfig::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,13 +56,6 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
|
|||
* @return IAddressBook[]
|
||||
*/
|
||||
public function getChildren() {
|
||||
if ($this->l10n === null) {
|
||||
$this->l10n = Util::getL10N('dav');
|
||||
}
|
||||
if ($this->config === null) {
|
||||
$this->config = Server::get(IConfig::class);
|
||||
}
|
||||
|
||||
/** @var string|array $principal */
|
||||
$principal = $this->principalUri;
|
||||
$addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri);
|
||||
|
|
|
|||
Loading…
Reference in a new issue