Skip to content

Commit

Permalink
fix(declarative_settings): changed events names (#247)
Browse files Browse the repository at this point in the history
DeclarativeSettings events renamed, reflecting this changes in AppAPI

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 authored Mar 12, 2024
1 parent 2dc82de commit 36aaac2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
use OCP\IUserSession;
use OCP\Profiler\IProfiler;
use OCP\SabrePluginEvent;
use OCP\Settings\GetDeclarativeSettingsValueEvent;
use OCP\Settings\RegisterDeclarativeSettingsFormEvent;
use OCP\Settings\SetDeclarativeSettingsValueEvent;
use OCP\Settings\Events\DeclarativeSettingsGetValueEvent;
use OCP\Settings\Events\DeclarativeSettingsRegisterFormEvent;
use OCP\Settings\Events\DeclarativeSettingsSetValueEvent;
use OCP\User\Events\UserDeletedEvent;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
Expand Down Expand Up @@ -70,9 +70,9 @@ public function register(IRegistrationContext $context): void {
$context->registerNotifierService(ExAppNotifier::class);
$context->registerNotifierService(ExAppAdminNotifier::class);

$context->registerEventListener(RegisterDeclarativeSettingsFormEvent::class, RegisterDeclarativeSettingsListener::class);
$context->registerEventListener(GetDeclarativeSettingsValueEvent::class, GetValueListener::class);
$context->registerEventListener(SetDeclarativeSettingsValueEvent::class, SetValueListener::class);
$context->registerEventListener(DeclarativeSettingsRegisterFormEvent::class, RegisterDeclarativeSettingsListener::class);
$context->registerEventListener(DeclarativeSettingsGetValueEvent::class, GetValueListener::class);
$context->registerEventListener(DeclarativeSettingsSetValueEvent::class, SetValueListener::class);

$container = $this->getContainer();
try {
Expand Down
4 changes: 2 additions & 2 deletions lib/Listener/DeclarativeSettings/GetValueListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Settings\DeclarativeSettingsTypes;
use OCP\Settings\GetDeclarativeSettingsValueEvent;
use OCP\Settings\Events\DeclarativeSettingsGetValueEvent;

/**
* @template-implements IEventListener<Event>
Expand All @@ -24,7 +24,7 @@ public function __construct(
}

public function handle(Event $event): void {
if (!$event instanceof GetDeclarativeSettingsValueEvent) {
if (!$event instanceof DeclarativeSettingsGetValueEvent) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use OCA\AppAPI\Service\UI\SettingsService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Settings\RegisterDeclarativeSettingsFormEvent;
use OCP\Settings\Events\DeclarativeSettingsRegisterFormEvent;

/**
* @template-implements IEventListener<Event>
Expand All @@ -19,7 +19,7 @@ public function __construct(
}

public function handle(Event $event): void {
if (!$event instanceof RegisterDeclarativeSettingsFormEvent) {
if (!$event instanceof DeclarativeSettingsRegisterFormEvent) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Listener/DeclarativeSettings/SetValueListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Settings\DeclarativeSettingsTypes;
use OCP\Settings\SetDeclarativeSettingsValueEvent;
use OCP\Settings\Events\DeclarativeSettingsSetValueEvent;

/**
* @template-implements IEventListener<Event>
Expand All @@ -24,7 +24,7 @@ public function __construct(
}

public function handle(Event $event): void {
if (!$event instanceof SetDeclarativeSettingsValueEvent) {
if (!$event instanceof DeclarativeSettingsSetValueEvent) {
return;
}

Expand Down
30 changes: 15 additions & 15 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@
<code>VersionParser</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/GetValueListener.php">
<UndefinedClass>
<code>DeclarativeSettingsGetValueEvent</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/RegisterDeclarativeSettingsListener.php">
<UndefinedClass>
<code>DeclarativeSettingsRegisterFormEvent</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/SetValueListener.php">
<UndefinedClass>
<code>DeclarativeSettingsSetValueEvent</code>
</UndefinedClass>
</file>
<file src="lib/Listener/LoadFilesPluginListener.php">
<ImplementedParamTypeMismatch>
<code>$event</code>
Expand Down Expand Up @@ -91,19 +106,4 @@
<code>Request</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/GetValueListener.php">
<UndefinedClass>
<code>GetDeclarativeSettingsValueEvent</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/RegisterDeclarativeSettingsListener.php">
<UndefinedClass>
<code>RegisterDeclarativeSettingsFormEvent</code>
</UndefinedClass>
</file>
<file src="lib/Listener/DeclarativeSettings/SetValueListener.php">
<UndefinedClass>
<code>SetDeclarativeSettingsValueEvent</code>
</UndefinedClass>
</file>
</files>

0 comments on commit 36aaac2

Please sign in to comment.