Skip to content

feat(dav): Emit a typed event to deprecate OCA\DAV\Connector\Sabre::addPlugin - #39305

Merged
nickvergessen merged 1 commit into
masterfrom
bugfix/noid/sabre-plugin-events
Jul 18, 2023
Merged

feat(dav): Emit a typed event to deprecate OCA\DAV\Connector\Sabre::addPlugin#39305
nickvergessen merged 1 commit into
masterfrom
bugfix/noid/sabre-plugin-events

Conversation

@nickvergessen

Copy link
Copy Markdown
Member

Checklist

@nickvergessennickvergessen added enhancement 3. to review Waiting for reviews feature: dav pending documentation This pull request needs an associated documentation update labels Jul 11, 2023
@nickvergessennickvergessen added this to the Nextcloud 28 milestone Jul 11, 2023
@nickvergessen
nickvergessen requested review from a team, ChristophWurst and come-ncJuly 11, 2023 09:56
@nickvergessennickvergessen self-assigned this Jul 11, 2023
@nickvergessen
nickvergessen requested review from ArtificialOwl and icewind1991 and removed request for a teamJuly 11, 2023 09:56
Comment threadapps/dav/appinfo/v1/webdav.php
@nickvergessen
nickvergessenforce-pushed the bugfix/noid/sabre-plugin-events branch from 8245c21 to f2edad2CompareJuly 14, 2023 09:43
…ddPlugin
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
nickvergessenforce-pushed the bugfix/noid/sabre-plugin-events branch from f2edad2 to 72667a6CompareJuly 17, 2023 14:06
@kesselb

Copy link
Copy Markdown
Contributor

Super nitpick suggestion: Rename SabrePluginAddEvent to SabrePluginAddPluginEvent

To use the same "pattern" as for SabrePluginAuthInitEvent ;)

EventClass
OCA\DAV\Connector\Sabre::authInitSabrePluginAuthInitEvent
OCA\DAV\Connector\Sabre::addPluginSabrePluginAddPluginEvent

// allow setup of additional plugins
$event = new \OCP\SabrePluginEvent($server);
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
$event = new \OCA\DAV\Events\SabrePluginAddEvent($server);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$event = new \OCA\DAV\Events\SabrePluginAddEvent($server);
$typedEvent = new \OCA\DAV\Events\SabrePluginAddEvent($server);

$event = new \OCP\SabrePluginEvent($server);
$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
$event = new \OCA\DAV\Events\SabrePluginAddEvent($server);
$dispatcher->dispatchTyped($event);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$dispatcher->dispatchTyped($event);
$dispatcher->dispatchTyped($typedEvent);

@nickvergessen

Copy link
Copy Markdown
MemberAuthor

SabrePluginAddPluginEvent

I'll pass on this one with: https://docs.nextcloud.com/server/latest/developer_manual/basics/events.html#naming-scheme

The name should reflect the subject and the actions. Suffixing event classes with Event makes it easier to recognize their purpose.

<subject><action>Event => <SabrePlugin><Add>Event 🤷🏼

@nickvergessen
nickvergessen merged commit 8e90cc0 into masterJul 18, 2023
@nickvergessen
nickvergessen deleted the bugfix/noid/sabre-plugin-events branch July 18, 2023 13:30
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Docs in nextcloud/documentation#10858

@nickvergessennickvergessen removed the pending documentation This pull request needs an associated documentation update label Jul 28, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@nickvergessen@kesselb@tcitworld@come-nc