Skip to content

Commit 443424d

Browse files
committed
refactor: Don't overwrite constructors
Signed-off-by: Carl Schwan <[email protected]>
1 parent 1e3bc59 commit 443424d

File tree

5 files changed

+8
-22
lines changed

5 files changed

+8
-22
lines changed

apps/admin_audit/lib/Listener/TagEventListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
use OCP\EventDispatcher\Event;
1515
use OCP\EventDispatcher\IEventListener;
1616
use OCP\SystemTag\Events\TagCreatedEvent;
17-
use OCP\SystemTag\Events\TagDeletedEvent;
18-
use OCP\SystemTag\Events\TagUpdatedEvent;
1917

2018
/**
21-
* @template-implements IEventListener<TagCreatedEvent|TagUpdatedEvent|TagDeletedEvent>
19+
* @template-implements IEventListener<TagCreatedEvent>
2220
*/
2321
class TagEventListener extends Action implements IEventListener {
2422
public function handle(Event $event): void {

apps/systemtags/lib/Activity/TagListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function handleTagEvent(TagAssignedEvent|TagUnassignedEvent $event) {
127127
foreach ($event->getObjectIds() as $objectId) {
128128
$mounts = $cache->getMountsForFileId((int)$objectId);
129129
if (empty($mounts)) {
130-
return;
130+
continue;
131131
}
132132

133133
$users = [];

lib/public/SystemTag/Events/AbstractTagEvent.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH
7-
* SPDX-FileContributor: Carl Schwan
6+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
87
* SPDX-License-Identifier: AGPL-3.0-or-later
98
*/
109

@@ -15,19 +14,18 @@
1514
use OCP\SystemTag\ISystemTag;
1615

1716
/**
18-
* Abstract event related to the lifecyle of a tag.
17+
* Abstract event related to the lifecycle of a tag.
1918
*
2019
* @since 34.0.0
2120
*/
2221
#[Consumable(since: '34.0.0')]
2322
abstract class AbstractTagEvent extends Event {
24-
protected function __construct(
25-
readonly private ISystemTag $tag,
23+
public function __construct(
24+
private readonly ISystemTag $tag,
2625
) {
2726
}
2827

2928
/**
30-
* @return ISystemTag
3129
* @since 34.0.0
3230
*/
3331
public function getTag(): ISystemTag {

lib/public/SystemTag/Events/TagCreatedEvent.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
declare(strict_types=1);
44

55
/**
6-
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH
7-
* SPDX-FileContributor: Carl Schwan
6+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
87
* SPDX-License-Identifier: AGPL-3.0-or-later
98
*/
109

1110
namespace OCP\SystemTag\Events;
1211

1312
use OCP\AppFramework\Attribute\Consumable;
14-
use OCP\SystemTag\ISystemTag;
1513

1614
/**
1715
* Event triggered when creating a new tag.
@@ -20,7 +18,4 @@
2018
*/
2119
#[Consumable(since: '34.0.0')]
2220
class TagCreatedEvent extends AbstractTagEvent {
23-
public function __construct(ISystemTag $tag) {
24-
parent::__construct($tag);
25-
}
2621
}

lib/public/SystemTag/Events/TagDeletedEvent.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
declare(strict_types=1);
44

55
/**
6-
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH
7-
* SPDX-FileContributor: Carl Schwan
6+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
87
* SPDX-License-Identifier: AGPL-3.0-or-later
98
*/
109

1110
namespace OCP\SystemTag\Events;
1211

1312
use OCP\AppFramework\Attribute\Consumable;
14-
use OCP\SystemTag\ISystemTag;
1513

1614
/**
1715
* Event triggered when deleting a new tag.
@@ -20,7 +18,4 @@
2018
*/
2119
#[Consumable(since: '34.0.0')]
2220
class TagDeletedEvent extends AbstractTagEvent {
23-
public function __construct(ISystemTag $tag) {
24-
parent::__construct($tag);
25-
}
2621
}

0 commit comments

Comments
 (0)