Remove since from implementations and fix some more style

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-05-25 09:28:18 +02:00
parent 9626138873
commit 2a2ca4dba5
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
6 changed files with 11 additions and 37 deletions

View File

@ -75,22 +75,22 @@ class Backend {
/**
* Creates activities when a calendar was updated
*
* @param array $calendarData
* @param array $addressbookData
* @param array $shares
* @param array $properties
*/
public function onAddressbookUpdate(array $calendarData, array $shares, array $properties): void {
$this->triggerAddressbookActivity(Addressbook::SUBJECT_UPDATE, $calendarData, $shares, $properties);
public function onAddressbookUpdate(array $addressbookData, array $shares, array $properties): void {
$this->triggerAddressbookActivity(Addressbook::SUBJECT_UPDATE, $addressbookData, $shares, $properties);
}
/**
* Creates activities when a calendar was deleted
*
* @param array $calendarData
* @param array $addressbookData
* @param array $shares
*/
public function onAddressbookDelete(array $calendarData, array $shares): void {
$this->triggerAddressbookActivity(Addressbook::SUBJECT_DELETE, $calendarData, $shares);
public function onAddressbookDelete(array $addressbookData, array $shares): void {
$this->triggerAddressbookActivity(Addressbook::SUBJECT_DELETE, $addressbookData, $shares);
}
/**
@ -458,7 +458,7 @@ class Backend {
* @param array $shares
* @return string[]
*/
protected function getUsersForShares(array $shares) {
protected function getUsersForShares(array $shares): array {
$users = $groups = [];
foreach ($shares as $share) {
$principal = explode('/', $share['{http://owncloud.org/ns}principal']);

View File

@ -42,7 +42,6 @@ class Filter implements IFilter {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
*/
public function getIdentifier(): string {
return 'contacts';
@ -50,7 +49,6 @@ class Filter implements IFilter {
/**
* @return string A translated string
* @since 11.0.0
*/
public function getName(): string {
return $this->l->t('Contacts');
@ -60,7 +58,6 @@ class Filter implements IFilter {
* @return int whether the filter should be rather on the top or bottom of
* the admin section. The filters are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority(): int {
return 40;
@ -68,7 +65,6 @@ class Filter implements IFilter {
/**
* @return string Full URL to an icon, empty string when none is given
* @since 11.0.0
*/
public function getIcon(): string {
return $this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg'));
@ -77,7 +73,6 @@ class Filter implements IFilter {
/**
* @param string[] $types
* @return string[] An array of allowed apps from which activities should be displayed
* @since 11.0.0
*/
public function filterTypes(array $types): array {
return array_intersect(['contacts'], $types);
@ -85,7 +80,6 @@ class Filter implements IFilter {
/**
* @return string[] An array of allowed apps from which activities should be displayed
* @since 11.0.0
*/
public function allowedApps(): array {
return [];

View File

@ -52,14 +52,6 @@ class Addressbook extends Base {
/** @var IEventMerger */
protected $eventMerger;
/**
* @param IFactory $languageFactory
* @param IURLGenerator $url
* @param IManager $activityManager
* @param IUserManager $userManager
* @param IGroupManager $groupManager
* @param IEventMerger $eventMerger
*/
public function __construct(IFactory $languageFactory,
IURLGenerator $url,
IManager $activityManager,
@ -78,7 +70,6 @@ class Addressbook extends Base {
* @param IEvent|null $previousEvent
* @return IEvent
* @throws \InvalidArgumentException
* @since 11.0.0
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
if ($event->getApp() !== 'dav' || $event->getType() !== 'addressbook') {

View File

@ -52,12 +52,9 @@ abstract class Base implements IProvider {
/** @var IURLGenerator */
protected $url;
/**
* @param IUserManager $userManager
* @param IGroupManager $groupManager
* @param IURLGenerator $urlGenerator
*/
public function __construct(IUserManager $userManager, IGroupManager $groupManager, IURLGenerator $urlGenerator) {
public function __construct(IUserManager $userManager,
IGroupManager $groupManager,
IURLGenerator $urlGenerator) {
$this->userManager = $userManager;
$this->groupManager = $groupManager;
$this->url = $urlGenerator;

View File

@ -72,7 +72,6 @@ class Card extends Base {
* @param IEvent|null $previousEvent
* @return IEvent
* @throws \InvalidArgumentException
* @since 11.0.0
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
if ($event->getApp() !== 'dav' || $event->getType() !== 'card') {
@ -91,7 +90,7 @@ class Card extends Base {
$subject = $l->t('{actor} created contact {card} in addressbook {addressbook}');
} elseif ($event->getSubject() === self::SUBJECT_ADD . '_self') {
$subject = $l->t('You created contact {card} in addressbook {addressbook}');
} elseif ($event->getSubject() === self::SUBJECT_DELETE ) {
} elseif ($event->getSubject() === self::SUBJECT_DELETE) {
$subject = $l->t('{actor} deleted contact {card} from addressbook {addressbook}');
} elseif ($event->getSubject() === self::SUBJECT_DELETE . '_self') {
$subject = $l->t('You deleted contact {card} from addressbook {addressbook}');

View File

@ -30,7 +30,6 @@ use OCA\DAV\CalDAV\Activity\Setting\CalDAVSetting;
class Setting extends CalDAVSetting {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
*/
public function getIdentifier(): string {
return 'contacts';
@ -38,7 +37,6 @@ class Setting extends CalDAVSetting {
/**
* @return string A translated string
* @since 11.0.0
*/
public function getName(): string {
return $this->l->t('A <strong>contact</strong> or <strong>addressbook</strong> was modified');
@ -48,7 +46,6 @@ class Setting extends CalDAVSetting {
* @return int whether the filter should be rather on the top or bottom of
* the admin section. The filters are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* @since 11.0.0
*/
public function getPriority(): int {
return 50;
@ -56,7 +53,6 @@ class Setting extends CalDAVSetting {
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function canChangeStream(): bool {
return true;
@ -64,7 +60,6 @@ class Setting extends CalDAVSetting {
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function isDefaultEnabledStream(): bool {
return true;
@ -72,7 +67,6 @@ class Setting extends CalDAVSetting {
/**
* @return bool True when the option can be changed for the mail
* @since 11.0.0
*/
public function canChangeMail(): bool {
return true;
@ -80,7 +74,6 @@ class Setting extends CalDAVSetting {
/**
* @return bool True when the option can be changed for the stream
* @since 11.0.0
*/
public function isDefaultEnabledMail(): bool {
return false;